HID: sensor-hub: correct dyn_callback_lock IRQ-safe change
Commit 0ccf091d1f
("HID: sensor-hub:
make dyn_callback_lock IRQ-safe) was supposed to change locks
in sensor_hub_get_callback(), but missed.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
f9d904acb3
commit
ed11977095
|
@ -135,8 +135,9 @@ static struct hid_sensor_hub_callbacks *sensor_hub_get_callback(
|
||||||
{
|
{
|
||||||
struct hid_sensor_hub_callbacks_list *callback;
|
struct hid_sensor_hub_callbacks_list *callback;
|
||||||
struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
|
struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock(&pdata->dyn_callback_lock);
|
spin_lock_irqsave(&pdata->dyn_callback_lock, flags);
|
||||||
list_for_each_entry(callback, &pdata->dyn_callback_list, list)
|
list_for_each_entry(callback, &pdata->dyn_callback_list, list)
|
||||||
if (callback->usage_id == usage_id &&
|
if (callback->usage_id == usage_id &&
|
||||||
(collection_index >=
|
(collection_index >=
|
||||||
|
@ -145,10 +146,11 @@ static struct hid_sensor_hub_callbacks *sensor_hub_get_callback(
|
||||||
callback->hsdev->end_collection_index)) {
|
callback->hsdev->end_collection_index)) {
|
||||||
*priv = callback->priv;
|
*priv = callback->priv;
|
||||||
*hsdev = callback->hsdev;
|
*hsdev = callback->hsdev;
|
||||||
spin_unlock(&pdata->dyn_callback_lock);
|
spin_unlock_irqrestore(&pdata->dyn_callback_lock,
|
||||||
|
flags);
|
||||||
return callback->usage_callback;
|
return callback->usage_callback;
|
||||||
}
|
}
|
||||||
spin_unlock(&pdata->dyn_callback_lock);
|
spin_unlock_irqrestore(&pdata->dyn_callback_lock, flags);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue