diff options
author | Even Xu <even.xu@intel.com> | 2018-09-12 02:44:13 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-09-24 12:20:06 +0300 |
commit | d0b41230e80cd27e78cd3767da463e6cd0246de7 (patch) | |
tree | e0d4fe62bfeb3f113b9c4bacc893ee902bf7952d /drivers/hid/intel-ish-hid/ishtp/bus.c | |
parent | 5e335542de83558e46d28de1008a1c37d5d6679a (diff) | |
download | linux-d0b41230e80cd27e78cd3767da463e6cd0246de7.tar.xz |
HID: intel-ish-hid: ishtp: add helper function for driver data get/set
Add helper function ishtp_set_drvdata() and ishtp_get_drvdata() for
different ISH client drivers to set/get private driver data.
Signed-off-by: Even Xu <even.xu@intel.com>
Reviewed-by: Andriy Shevchenko <andriy.shevchenko@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/intel-ish-hid/ishtp/bus.c')
-rw-r--r-- | drivers/hid/intel-ish-hid/ishtp/bus.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c index 2623a567ffba..d5db5e96e4a1 100644 --- a/drivers/hid/intel-ish-hid/ishtp/bus.c +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c @@ -564,6 +564,33 @@ void ishtp_put_device(struct ishtp_cl_device *cl_device) EXPORT_SYMBOL(ishtp_put_device); /** + * ishtp_set_drvdata() - set client driver data + * @cl_device: client device instance + * @data: driver data need to be set + * + * Set client driver data to cl_device->driver_data. + */ +void ishtp_set_drvdata(struct ishtp_cl_device *cl_device, void *data) +{ + cl_device->driver_data = data; +} +EXPORT_SYMBOL(ishtp_set_drvdata); + +/** + * ishtp_get_drvdata() - get client driver data + * @cl_device: client device instance + * + * Get client driver data from cl_device->driver_data. + * + * Return: pointer of driver data + */ +void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device) +{ + return cl_device->driver_data; +} +EXPORT_SYMBOL(ishtp_get_drvdata); + +/** * ishtp_bus_new_client() - Create a new client * @dev: ISHTP device instance * |