diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2017-04-07 17:16:34 -0700 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2017-04-08 15:36:47 +0100 |
commit | c94f5806cd0be4c7d4dabb89d1ae1088ed4332e7 (patch) | |
tree | cd6b8616860cdc7978b461d66904d8970c8ceab5 /drivers/iio/common/hid-sensors | |
parent | 25a85bed36f7da4e411f8744c2962e4e1003d7ea (diff) | |
download | linux-c94f5806cd0be4c7d4dabb89d1ae1088ed4332e7.tar.gz linux-c94f5806cd0be4c7d4dabb89d1ae1088ed4332e7.tar.bz2 linux-c94f5806cd0be4c7d4dabb89d1ae1088ed4332e7.zip |
iio: hid-sensor: Fix unbalanced pm_runtime_enable error
When a hid sensor module is removed and modprobed again we see
error for unbalanced pm_runtime. This issue is caused by not
deactivating runtime PM on removal. So on modprobe again when
activated again, this will print this error.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/common/hid-sensors')
-rw-r--r-- | drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index ecf592d69043..8cadc4880359 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c @@ -138,6 +138,10 @@ static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig, void hid_sensor_remove_trigger(struct hid_sensor_common *attrb) { + pm_runtime_disable(&attrb->pdev->dev); + pm_runtime_set_suspended(&attrb->pdev->dev); + pm_runtime_put_noidle(&attrb->pdev->dev); + cancel_work_sync(&attrb->work); iio_trigger_unregister(attrb->trigger); iio_trigger_free(attrb->trigger); |