diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2019-03-18 22:14:20 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2019-03-19 13:57:23 +0300 |
commit | 7ab2184246bd0b32e427ff60bfa07a2435011ce2 (patch) | |
tree | c6a8d86374b53036a2b015ed40969ded26f4c0cd /drivers/hid/intel-ish-hid/ishtp/bus.c | |
parent | 6b3f75f75fdd225f8c5927b938c29bd24c21fc1b (diff) | |
download | linux-7ab2184246bd0b32e427ff60bfa07a2435011ce2.tar.xz |
HID: intel-ish-hid: Hide members of struct ishtp_cl_device
ISH clients don't need to access any field of struct ishtp_cl_device. To
avoid this create an interface functions instead where it is required.
In the case of ishtp_cl_allocate(), modify the parameters so that the
clients don't have to dereference.
Clients can also use tracing, here a new interface is added to get the
common trace function pointer, instead of direct call.
The new interface functions defined in one external header file, named
intel-ish-client-if.h. This is the only header files all ISHTP clients
must include.
Signed-off-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 6348fee8aadc..308853eab91c 100644 --- a/drivers/hid/intel-ish-hid/ishtp/bus.c +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c @@ -828,6 +828,33 @@ int ishtp_use_dma_transfer(void) } /** + * ishtp_device() - Return device pointer + * + * This interface is used to return device pointer from ishtp_cl_device + * instance. + * + * Return: device *. + */ +struct device *ishtp_device(struct ishtp_cl_device *device) +{ + return &device->dev; +} +EXPORT_SYMBOL(ishtp_device); + +/** + * ishtp_trace_callback() - Return trace callback + * + * This interface is used to return trace callback function pointer. + * + * Return: void *. + */ +void *ishtp_trace_callback(struct ishtp_cl_device *cl_device) +{ + return cl_device->ishtp_dev->print_log; +} +EXPORT_SYMBOL(ishtp_trace_callback); + +/** * ishtp_bus_register() - Function to register bus * * This register ishtp bus |