From: Todd Poynor Date: Thu, 2 Aug 2018 08:42:43 +0000 (-0700) Subject: staging: gasket: remove "reset type" param from framework X-Git-Tag: v4.19-rc1~101^2~99 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1c65a2e2f68eae5d73b41dee003b8135dfcf6928;p=tomoyo%2Ftomoyo-test1.git staging: gasket: remove "reset type" param from framework The "type of reset" parameter to the gasket device reset APIs isn't required by the only gasket device submitted upstream, apex. The framework documents the param as private to the device driver and a pass-through at the gasket layer, but the gasket core calls the device driver with a hardcoded reset type of zero, which is not documented as having a predefined meaning. In light of all this, remove the reset type parameter from the framework. Remove the reset ioctl reset type parameter, and bump the framework version number to reflect the interface change. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gasket/gasket.h b/drivers/staging/gasket/gasket.h index 9f709f0c5a2b..a0f065c517a5 100644 --- a/drivers/staging/gasket/gasket.h +++ b/drivers/staging/gasket/gasket.h @@ -52,8 +52,8 @@ struct gasket_coherent_alloc_config_ioctl { /* Base number for all Gasket-common IOCTLs */ #define GASKET_IOCTL_BASE 0xDC -/* Reset the device using the specified reset type. */ -#define GASKET_IOCTL_RESET _IOW(GASKET_IOCTL_BASE, 0, unsigned long) +/* Reset the device. */ +#define GASKET_IOCTL_RESET _IO(GASKET_IOCTL_BASE, 0) /* Associate the specified [event]fd with the specified interrupt. */ #define GASKET_IOCTL_SET_EVENTFD \ diff --git a/drivers/staging/gasket/gasket_constants.h b/drivers/staging/gasket/gasket_constants.h index 82ed3f21e8ae..50d87c7b178c 100644 --- a/drivers/staging/gasket/gasket_constants.h +++ b/drivers/staging/gasket/gasket_constants.h @@ -3,7 +3,7 @@ #ifndef __GASKET_CONSTANTS_H__ #define __GASKET_CONSTANTS_H__ -#define GASKET_FRAMEWORK_VERSION "1.1.1" +#define GASKET_FRAMEWORK_VERSION "1.1.2" /* * The maximum number of simultaneous device types supported by the framework. diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c index f76f4a0ecbac..2b75f100da4d 100644 --- a/drivers/staging/gasket/gasket_core.c +++ b/drivers/staging/gasket/gasket_core.c @@ -1294,7 +1294,7 @@ static int gasket_release(struct inode *inode, struct file *file) ownership->owner = 0; /* Forces chip reset before we unmap the page tables. */ - driver_desc->device_reset_cb(gasket_dev, 0); + driver_desc->device_reset_cb(gasket_dev); for (i = 0; i < driver_desc->num_page_tables; ++i) { gasket_page_table_unmap_all(gasket_dev->page_table[i]); @@ -1622,18 +1622,18 @@ const char *gasket_num_name_lookup(uint num, } EXPORT_SYMBOL(gasket_num_name_lookup); -int gasket_reset(struct gasket_dev *gasket_dev, uint reset_type) +int gasket_reset(struct gasket_dev *gasket_dev) { int ret; mutex_lock(&gasket_dev->mutex); - ret = gasket_reset_nolock(gasket_dev, reset_type); + ret = gasket_reset_nolock(gasket_dev); mutex_unlock(&gasket_dev->mutex); return ret; } EXPORT_SYMBOL(gasket_reset); -int gasket_reset_nolock(struct gasket_dev *gasket_dev, uint reset_type) +int gasket_reset_nolock(struct gasket_dev *gasket_dev) { int ret; int i; @@ -1643,8 +1643,7 @@ int gasket_reset_nolock(struct gasket_dev *gasket_dev, uint reset_type) if (!driver_desc->device_reset_cb) return 0; - /* Perform a device reset of the requested type. */ - ret = driver_desc->device_reset_cb(gasket_dev, reset_type); + ret = driver_desc->device_reset_cb(gasket_dev); if (ret) { dev_dbg(gasket_dev->dev, "Device reset cb returned %d.\n", ret); diff --git a/drivers/staging/gasket/gasket_core.h b/drivers/staging/gasket/gasket_core.h index 713bf42de41a..67f5960943a8 100644 --- a/drivers/staging/gasket/gasket_core.h +++ b/drivers/staging/gasket/gasket_core.h @@ -580,17 +580,12 @@ struct gasket_driver_desc { /* * device_reset_cb: Reset the hardware in question. * @dev: Pointer to the gasket_dev structure for this device. - * @type: Integer representing reset type. (All - * Gasket resets have an integer representing their type - * defined in (device)_ioctl.h; the specific resets are - * device-dependent, but are handled in the device-specific - * callback anyways.) * * Called by reset ioctls. This function should not * lock the gasket_dev mutex. It should return 0 on success * and an error on failure. */ - int (*device_reset_cb)(struct gasket_dev *dev, uint reset_type); + int (*device_reset_cb)(struct gasket_dev *dev); }; /* @@ -615,15 +610,13 @@ void gasket_unregister_device(const struct gasket_driver_desc *desc); /* * Reset the Gasket device. * @gasket_dev: Gasket device struct. - * @reset_type: Uint representing requested reset type. Should be - * valid in the underlying callback. * * Calls device_reset_cb. Returns 0 on success and an error code othewrise. * gasket_reset_nolock will not lock the mutex, gasket_reset will. * */ -int gasket_reset(struct gasket_dev *gasket_dev, uint reset_type); -int gasket_reset_nolock(struct gasket_dev *gasket_dev, uint reset_type); +int gasket_reset(struct gasket_dev *gasket_dev); +int gasket_reset_nolock(struct gasket_dev *gasket_dev); /* * Memory management functions. These will likely be spun off into their own diff --git a/drivers/staging/gasket/gasket_ioctl.c b/drivers/staging/gasket/gasket_ioctl.c index d3397cc74e69..0ca48e688818 100644 --- a/drivers/staging/gasket/gasket_ioctl.c +++ b/drivers/staging/gasket/gasket_ioctl.c @@ -304,8 +304,7 @@ long gasket_handle_ioctl(struct file *filp, uint cmd, void __user *argp) */ switch (cmd) { case GASKET_IOCTL_RESET: - trace_gasket_ioctl_integer_data(arg); - retval = gasket_reset(gasket_dev, arg); + retval = gasket_reset(gasket_dev); break; case GASKET_IOCTL_SET_EVENTFD: retval = gasket_set_event_fd(gasket_dev, argp);