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 <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Todd Poynor 2018-08-02 01:42:43 -07:00 committed by Greg Kroah-Hartman
parent 84d979bc89
commit 1c65a2e2f6
5 changed files with 12 additions and 21 deletions

View file

@ -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 \

View file

@ -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.

View file

@ -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);

View file

@ -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

View file

@ -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);