diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2013-10-30 22:48:00 +0000 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-10-13 15:41:11 +0200 |
commit | 40cd8b4513507a0f03614c8821b08543e573ef00 (patch) | |
tree | 120437df331934eebc4566e3fc2da0fe7eb39fc0 /include | |
parent | 0fc1b58e1d892491ede584fe82041056a68d2438 (diff) |
iio: hid_Sensors: fix crash during trigger unregister
commit ec7f68e07bf10198717b7824c78201b46bbf1956 upstream.
We can't store the trigger instance created by iio_trigger_alloc, in
trig field of iio_device structure. This needs to be stored in the
driver private data. Othewise it can result in crash during module
unload. Hence created a trig_ptr in the common data structure
for each HID sensor IIO driver and storing here.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hid-sensor-hub.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index 32ba45158d39..c32411b4a696 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h @@ -21,6 +21,8 @@ #include <linux/hid.h> #include <linux/hid-sensor-ids.h> +#include <linux/iio/iio.h> +#include <linux/iio/trigger.h> /** * struct hid_sensor_hub_attribute_info - Attribute info @@ -166,6 +168,7 @@ struct hid_sensor_common { struct platform_device *pdev; unsigned usage_id; bool data_ready; + struct iio_trigger *trigger; struct hid_sensor_hub_attribute_info poll; struct hid_sensor_hub_attribute_info report_state; struct hid_sensor_hub_attribute_info power_state; |