linux-stable/drivers/iio/gyro
Miaoqian Lin 72b0fba2dd 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:48:04 +01:00
..
adis16080.c iio: gyro: adis16080: Fix formatting issue 2020-09-21 18:41:37 +01:00
adis16130.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
adis16136.c iio: adis: Cleanout unused headers 2021-06-04 09:28:10 +01:00
adis16260.c iio: adis: Cleanout unused headers 2021-06-04 09:28:10 +01:00
adxrs290.c iio: gyro: adxrs290: fix data signedness 2021-12-14 10:57:20 +01:00
adxrs450.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
bmg160.h
bmg160_core.c iio: Fix error handling for PM 2022-03-02 11:48:04 +01:00
bmg160_i2c.c iio: gyro: bmg160_i2c: Use vsprintf extension %pe for symbolic error name 2020-04-19 16:56:15 +01:00
bmg160_spi.c iio: gyro: bmg160_spi: Use vsprintf extension %pe for symbolic error name 2020-04-19 16:56:16 +01:00
fxas21002c.h iio: gyro: fxas21002c: Move 'fxas21002c_reg_fields' to the only file its used 2020-07-20 09:03:25 +01:00
fxas21002c_core.c 1st set of new IIO/counter device support, features and cleanup for 5.14 2021-06-09 12:11:49 +02:00
fxas21002c_i2c.c
fxas21002c_spi.c
hid-sensor-gyro-3d.c iio: hid-sensors: bind IIO channels alloc to device object 2021-07-13 18:21:53 +01:00
itg3200_buffer.c iio: itg3200: Call iio_trigger_notify_done() on error 2021-12-14 10:57:21 +01:00
itg3200_core.c iio: Drop Duplicated "mount-matrix" parameter 2021-06-03 18:24:13 +01:00
Kconfig iio: hid-sensors: select IIO_TRIGGERED_BUFFER under HID_SENSOR_IIO_TRIGGER 2021-05-10 14:01:48 +01:00
Makefile iio: gyro: Add driver support for ADXRS290 2020-08-22 10:53:20 +01:00
mpu3050-core.c iio: Drop Duplicated "mount-matrix" parameter 2021-06-03 18:24:13 +01:00
mpu3050-i2c.c iio: gyro: mpu3050: Use vsprintf extension %pe for symbolic error name 2020-04-19 16:56:16 +01:00
mpu3050.h
ssp_gyro_sensor.c iio: make use of devm_iio_kfifo_buffer_setup() helper 2021-03-11 20:47:01 +00:00
st_gyro.h iio: gyro: st_gyro: use devm_iio_triggered_buffer_setup() for buffer 2021-07-24 16:35:05 +01:00
st_gyro_buffer.c iio: gyro: st_gyro: use devm_iio_triggered_buffer_setup() for buffer 2021-07-24 16:35:05 +01:00
st_gyro_core.c iio: gyro: st_gyro: use devm_iio_triggered_buffer_setup() for buffer 2021-07-24 16:35:05 +01:00
st_gyro_i2c.c iio: st_sensors: disable regulators after device unregistration 2021-11-18 19:16:46 +01:00
st_gyro_spi.c iio: st_sensors: disable regulators after device unregistration 2021-11-18 19:16:46 +01:00