linux-stable/drivers/iio/imu
Miaoqian Lin a28f8dbd47 iio: Fix error handling for PM
commit 632fe0bb8c upstream.

The pm_runtime_enable will increase power disable depth.
If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable(). In the PM Runtime docs:
    Drivers in ->remove() callback should undo the runtime PM changes done
    in ->probe(). Usually this means calling pm_runtime_disable(),
    pm_runtime_dont_use_autosuspend() etc.
We should do this in error handling.

Fix this problem for the following drivers: bmc150, bmg160, kmx61,
kxcj-1013, mma9551, mma9553.

Fixes: 7d0ead5c3f ("iio: Reconcile operation order between iio_register/unregister and pm functions")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220106112309.16879-1-linmq006@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-02 11:41:12 +01:00
..
bmi160
inv_mpu6050
st_lsm6dsx iio: imu: st_lsm6dsx: Avoid potential array overflow in st_lsm6dsx_set_odr() 2021-11-26 10:47:16 +01:00
adis.c
adis16400.c iio: adis16400: do not return ints in irq handlers 2021-07-14 16:53:37 +02:00
adis16460.c
adis16480.c
adis_buffer.c iio: adis_buffer: do not return ints in irq handlers 2021-07-14 16:53:36 +02:00
adis_trigger.c
Kconfig
kmx61.c iio: Fix error handling for PM 2022-03-02 11:41:12 +01:00
Makefile