diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2015-05-07 14:26:34 -0700 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-05-12 14:13:20 +0200 |
commit | 2d94e5224e81c58986a8cf44a3bf4830ce5cb96e (patch) | |
tree | b12b410a0dc0fea939f8da807e8d83471bc1c111 /include | |
parent | 5006c1052aafa01dab5b0e643b7dac755b41f3bb (diff) | |
download | linux-2d94e5224e81c58986a8cf44a3bf4830ce5cb96e.tar.gz linux-2d94e5224e81c58986a8cf44a3bf4830ce5cb96e.tar.bz2 linux-2d94e5224e81c58986a8cf44a3bf4830ce5cb96e.zip |
HID: hid-sensor-hub: Fix debug lock warning
When CONFIG_DEBUG_LOCK_ALLOC is defined, mutex magic is compared and
warned for (l->magic != l), here l is the address of mutex pointer.
In hid-sensor-hub as part of hsdev creation, a per hsdev mutex is
initialized during MFD cell creation. This hsdev, which contains, mutex
is part of platform data for the a cell. But platform_data is copied
in platform_device_add_data() in platform.c. This copy will copy the
whole hsdev structure including mutex. But once copied the magic
will no longer match. So when client driver call
sensor_hub_input_attr_get_raw_value, this will trigger mutex warning.
So to avoid this allocate mutex dynamically. This will be same even
after copy.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hid-sensor-hub.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index 0408421d885f..0042bf330b99 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h @@ -74,7 +74,7 @@ struct sensor_hub_pending { * @usage: Usage id for this hub device instance. * @start_collection_index: Starting index for a phy type collection * @end_collection_index: Last index for a phy type collection - * @mutex: synchronizing mutex. + * @mutex_ptr: synchronizing mutex pointer. * @pending: Holds information of pending sync read request. */ struct hid_sensor_hub_device { @@ -84,7 +84,7 @@ struct hid_sensor_hub_device { u32 usage; int start_collection_index; int end_collection_index; - struct mutex mutex; + struct mutex *mutex_ptr; struct sensor_hub_pending pending; }; |