linux/drivers/iio/accel
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
..
adis16201.c iio: adis: Cleanout unused headers 2021-06-04 09:28:10 +01:00
adis16209.c iio: adis: Cleanout unused headers 2021-06-04 09:28:10 +01:00
adxl345_core.c iio: accel: adxl345: convert probe to device-managed functions 2021-07-19 09:51:59 +01:00
adxl345_i2c.c iio: accel: adxl345: convert probe to device-managed functions 2021-07-19 09:51:59 +01:00
adxl345_spi.c iio: accel: adxl345: convert probe to device-managed functions 2021-07-19 09:51:59 +01:00
adxl345.h iio: accel: adxl345: convert probe to device-managed functions 2021-07-19 09:51:59 +01:00
adxl372_i2c.c iio: adxl372_i2c: Add OF device ID table 2020-08-22 10:53:16 +01:00
adxl372_spi.c iio: adxl372_spi: change indentation for of_table 2020-08-22 10:53:15 +01:00
adxl372.c iio: core: move @id from struct iio_dev to struct iio_dev_opaque 2021-05-17 13:49:13 +01:00
adxl372.h
bma180.c iio: accel: bma180/bmc150: Move BMA254 to bmc150-accel driver 2021-06-13 17:00:18 +01:00
bma220_spi.c iio: accel: bma220: make suspend state setting more robust 2021-07-19 09:51:59 +01:00
bma400_core.c iio: Drop Duplicated "mount-matrix" parameter 2021-06-03 18:24:13 +01:00
bma400_i2c.c iio: accel: Add driver for the BMA400 2019-12-29 15:20:02 +00:00
bma400_spi.c iio: accel: bma400: add support for bma400 spi 2020-06-14 11:49:16 +01:00
bma400.h iio: accel: bma400: basic regulator support 2019-12-29 15:20:02 +00:00
bmc150-accel-core.c iio: Fix error handling for PM 2022-03-02 11:48:04 +01:00
bmc150-accel-i2c.c iio: accel: bmc150: Add support for BMC156 2021-08-08 16:48:30 +01:00
bmc150-accel-spi.c iio: accel: bmc150: Add support for BMC156 2021-08-08 16:48:30 +01:00
bmc150-accel.h iio: accel: bmc150: Add support for BMC156 2021-08-08 16:48:30 +01:00
bmi088-accel-core.c iio: accel: bmi088: Balance runtime pm + use pm_runtime_resume_and_get() 2021-05-17 13:54:27 +01:00
bmi088-accel-spi.c iio: accel: Add support for the Bosch-Sensortec BMI088 2021-03-11 20:46:58 +00:00
bmi088-accel.h iio: accel: Add support for the Bosch-Sensortec BMI088 2021-03-11 20:46:58 +00:00
cros_ec_accel_legacy.c iio: cros: unify hw fifo attributes without API changes 2021-03-25 19:13:52 +00:00
da280.c iio: accel: da280: convert probe to device-managed functions 2021-07-17 18:57:55 +01:00
da311.c iio: accel: da311: convert probe to device-managed functions 2021-07-17 18:53:53 +01:00
dmard06.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
dmard09.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
dmard10.c iio: accel: dmard10: convert probe to device-managed functions 2021-07-17 18:52:52 +01:00
fxls8962af-core.c iio: accel: fxls8962af: add padding to regmap for SPI 2022-03-02 11:48:03 +01:00
fxls8962af-i2c.c iio: accel: fxls8962af: add padding to regmap for SPI 2022-03-02 11:48:03 +01:00
fxls8962af-spi.c iio: accel: fxls8962af: add padding to regmap for SPI 2022-03-02 11:48:03 +01:00
fxls8962af.h iio: accel: fxls8962af: add padding to regmap for SPI 2022-03-02 11:48:03 +01:00
hid-sensor-accel-3d.c iio: hid-sensors: bind IIO channels alloc to device object 2021-07-13 18:21:53 +01:00
Kconfig Merge 5.14-rc6 into staging-next 2021-08-16 09:02:59 +02:00
kxcjk-1013.c iio: Fix error handling for PM 2022-03-02 11:48:04 +01:00
kxsd9-i2c.c iio: accel: kxsd9-i2c: Use mod_devicetable.h and drop of_match_ptr macro 2020-04-25 15:31:34 +01:00
kxsd9-spi.c
kxsd9.c iio: kxsd9: Don't return error code in trigger handler 2021-12-14 10:57:21 +01:00
kxsd9.h
Makefile iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers 2021-05-17 13:54:23 +01:00
mc3230.c iio: Remove kernel-doc keyword in file header comment 2021-03-25 19:13:49 +00:00
mma7455_core.c iio:accel:mma7455: Fix timestamp alignment and prevent data leak. 2020-08-22 11:38:52 +01:00
mma7455_i2c.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mma7455_spi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mma7455.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mma7660.c iio: Remove kernel-doc keyword in file header comment 2021-03-25 19:13:49 +00:00
mma8452.c iio: mma8452: Fix trigger reference couting 2021-12-14 10:57:20 +01:00
mma9551_core.c iio: accel: mma9551/3: Balance untime pm + use pm_runtime_resume_and_get() 2021-05-17 13:54:25 +01:00
mma9551_core.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
mma9551.c iio: Fix error handling for PM 2022-03-02 11:48:04 +01:00
mma9553.c iio: Fix error handling for PM 2022-03-02 11:48:04 +01:00
mxc4005.c iio: accel: mxc4005: Fix overread of data and alignment issue. 2021-05-17 13:54:28 +01:00
mxc6255.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
sca3000.c iio: accel: sca3000: kernel-doc fixes. Missing - and wrong function names. 2021-03-25 19:13:51 +00:00
sca3300.c iio: accel: Add driver for Murata SCA3300 accelerometer 2021-05-17 13:49:09 +01:00
ssp_accel_sensor.c iio: make use of devm_iio_kfifo_buffer_setup() helper 2021-03-11 20:47:01 +00:00
st_accel_buffer.c iio: accel: st_accel: use devm_iio_triggered_buffer_setup() for buffer 2021-07-24 16:35:05 +01:00
st_accel_core.c iio: accel: st_accel: use devm_iio_triggered_buffer_setup() for buffer 2021-07-24 16:35:05 +01:00
st_accel_i2c.c iio: st_sensors: disable regulators after device unregistration 2021-11-18 19:16:46 +01:00
st_accel_spi.c iio: st_sensors: disable regulators after device unregistration 2021-11-18 19:16:46 +01:00
st_accel.h iio: accel: st_accel: use devm_iio_triggered_buffer_setup() for buffer 2021-07-24 16:35:05 +01:00
stk8ba50.c iio: accel: stk8ba50: Fix buffer alignment in iio_push_to_buffers_with_timestamp() 2021-05-17 13:54:28 +01:00
stk8312.c iio: accel: stk8312: Fix buffer alignment in iio_push_to_buffers_with_timestamp() 2021-05-17 13:54:28 +01:00