aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2013-10-30 18:48:00 -0400
committerJonathan Cameron <jic23@kernel.org>2013-11-02 15:07:06 -0400
commitec7f68e07bf10198717b7824c78201b46bbf1956 (patch)
treeef26e0299c81501e6ba01e2c008578716e77cefb /include/linux
parent00582bf8e7ed30aadbd935e430143fa18f316f8d (diff)
iio: hid_Sensors: fix crash during trigger unregister
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hid-sensor-hub.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
index a265af294ea4..206a2af6b62b 100644
--- a/include/linux/hid-sensor-hub.h
+++ b/include/linux/hid-sensor-hub.h
@@ -21,6 +21,8 @@
21 21
22#include <linux/hid.h> 22#include <linux/hid.h>
23#include <linux/hid-sensor-ids.h> 23#include <linux/hid-sensor-ids.h>
24#include <linux/iio/iio.h>
25#include <linux/iio/trigger.h>
24 26
25/** 27/**
26 * struct hid_sensor_hub_attribute_info - Attribute info 28 * struct hid_sensor_hub_attribute_info - Attribute info
@@ -184,6 +186,7 @@ struct hid_sensor_common {
184 struct platform_device *pdev; 186 struct platform_device *pdev;
185 unsigned usage_id; 187 unsigned usage_id;
186 bool data_ready; 188 bool data_ready;
189 struct iio_trigger *trigger;
187 struct hid_sensor_hub_attribute_info poll; 190 struct hid_sensor_hub_attribute_info poll;
188 struct hid_sensor_hub_attribute_info report_state; 191 struct hid_sensor_hub_attribute_info report_state;
189 struct hid_sensor_hub_attribute_info power_state; 192 struct hid_sensor_hub_attribute_info power_state;