]> git.baikalelectronics.ru Git - kernel.git/commit
HID: intel-ish-hid: fix wrong driver_data usage
authorHyungwoo Yang <hyungwoo.yang@intel.com>
Thu, 6 Jun 2019 04:52:27 +0000 (21:52 -0700)
committerJiri Kosina <jkosina@suse.cz>
Wed, 26 Jun 2019 12:08:11 +0000 (14:08 +0200)
commit72809662d7658d2ec8e37d89d9382164282aa88d
tree99fe288f374305a9fd20c3dfb9d14bf8dc3b1ed1
parentbdce0495f0d15b8a78a7aa074d8aaa03be333d73
HID: intel-ish-hid: fix wrong driver_data usage

Currently, in suspend() and resume(), ishtp client drivers are using
driver_data to get "struct ishtp_cl_device" object which is set by
bus driver. It's wrong since the driver_data should not be owned bus.
driver_data should be owned by the corresponding ishtp client driver.
Due to this, some ishtp client driver like cros_ec_ishtp which uses
its driver_data to transfer its data to its child doesn't work correctly.

So this patch removes setting driver_data in bus drier and instead of
using driver_data to get "struct ishtp_cl_device", since "struct device"
is embedded in "struct ishtp_cl_device", we introduce a helper function
that returns "struct ishtp_cl_device" from "struct device".

Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/intel-ish-hid/ishtp-hid-client.c
drivers/hid/intel-ish-hid/ishtp/bus.c
include/linux/intel-ish-client-if.h