summaryrefslogtreecommitdiffstats
path: root/drivers/hid/intel-ish-hid/ishtp-hid.c
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2019-03-18 12:14:20 -0700
committerJiri Kosina <jkosina@suse.cz>2019-03-19 11:57:23 +0100
commit7ab2184246bd0b32e427ff60bfa07a2435011ce2 (patch)
treec6a8d86374b53036a2b015ed40969ded26f4c0cd /drivers/hid/intel-ish-hid/ishtp-hid.c
parent6b3f75f75fdd225f8c5927b938c29bd24c21fc1b (diff)
downloadlinux-stable-7ab2184246bd0b32e427ff60bfa07a2435011ce2.tar.gz
linux-stable-7ab2184246bd0b32e427ff60bfa07a2435011ce2.tar.bz2
linux-stable-7ab2184246bd0b32e427ff60bfa07a2435011ce2.zip
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-hid.c')
-rw-r--r--drivers/hid/intel-ish-hid/ishtp-hid.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c
index 5c7e127b0483..95a5b87d9105 100644
--- a/drivers/hid/intel-ish-hid/ishtp-hid.c
+++ b/drivers/hid/intel-ish-hid/ishtp-hid.c
@@ -14,6 +14,7 @@
*/
#include <linux/hid.h>
+#include <linux/intel-ish-client-if.h>
#include <uapi/linux/input.h>
#include "ishtp/client.h"
#include "ishtp-hid.h"
@@ -241,7 +242,8 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
hid->ll_driver = &ishtp_hid_ll_driver;
hid->bus = BUS_INTEL_ISHTP;
- hid->dev.parent = &client_data->cl_device->dev;
+ hid->dev.parent = ishtp_device(client_data->cl_device);
+
hid->version = le16_to_cpu(ISH_HID_VERSION);
hid->vendor = le16_to_cpu(client_data->hid_devices[cur_hid_dev].vid);
hid->product = le16_to_cpu(client_data->hid_devices[cur_hid_dev].pid);