linux/drivers/iio/gyro
Miaoqian Lin a28f8dbd47 iio: Fix error handling for PM
commit 632fe0bb8c5b9c06ec961f575ee42a6fff5eceeb 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
..
Kconfig
Makefile
adis16080.c
adis16130.c
adis16136.c
adis16260.c
adxrs450.c
bmg160.h
bmg160_core.c iio: Fix error handling for PM 2022-03-02 11:41:12 +01:00
bmg160_i2c.c
bmg160_spi.c
fxas21002c.h
fxas21002c_core.c iio: gyro: fxa21002c: Balance runtime pm + use pm_runtime_resume_and_get(). 2021-07-20 16:10:41 +02:00
fxas21002c_i2c.c
fxas21002c_spi.c
hid-sensor-gyro-3d.c
itg3200_buffer.c iio: itg3200: Call iio_trigger_notify_done() on error 2021-12-14 14:49:05 +01:00
itg3200_core.c
mpu3050-core.c iio: gyro: mpu3050: Fix reported temperature value 2021-05-19 10:08:31 +02:00
mpu3050-i2c.c
mpu3050.h
ssp_gyro_sensor.c
st_gyro.h
st_gyro_buffer.c
st_gyro_core.c
st_gyro_i2c.c
st_gyro_spi.c