linux-stable/drivers/iio/magnetometer
Alexandru Ardelean 42a6f69c5a iio: st_sensors: disable regulators after device unregistration
[ Upstream commit 9f0b3e0cc0 ]

Up until commit ea7e586bdd ("iio: st_sensors: move regulator retrieveal
to core") only the ST pressure driver seems to have had any regulator
disable. After that commit, the regulator handling was moved into the
common st_sensors logic.

In all instances of this regulator handling, the regulators were disabled
before unregistering the IIO device.
This can cause issues where the device would be powered down and still be
available to userspace, allowing it to send invalid/garbage data.

This change moves the st_sensors_power_disable() after the common probe
functions. These common probe functions also handle unregistering the IIO
device.

Fixes: 774487611c ("iio: pressure-core: st: Provide support for the Vdd power supply")
Fixes: ea7e586bdd ("iio: st_sensors: move regulator retrieveal to core")
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Denis CIOCCA <denis.ciocca@st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210823112204.243255-2-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-18 19:16:46 +01:00
..
ak8974.c iio: Drop Duplicated "mount-matrix" parameter 2021-06-03 18:24:13 +01:00
ak8975.c iio: Drop Duplicated "mount-matrix" parameter 2021-06-03 18:24:13 +01:00
bmc150_magn.c iio: Drop Duplicated "mount-matrix" parameter 2021-06-03 18:24:13 +01:00
bmc150_magn.h
bmc150_magn_i2c.c iio: magnetometer: bmc150: Add proper compatible for BMM150 2020-07-07 20:24:07 +01:00
bmc150_magn_spi.c iio: magn: bmc150: Use vsprintf extension %pe for symbolic error name 2020-04-19 16:56:18 +01:00
hid-sensor-magn-3d.c iio: hid-sensors: Update header includes 2021-06-16 14:53:13 +01:00
hmc5843.h iio: magn: hmc5843: Fix buffer alignment in iio_push_to_buffers_with_timestamp() 2021-05-17 13:54:29 +01:00
hmc5843_core.c iio: Drop Duplicated "mount-matrix" parameter 2021-06-03 18:24:13 +01:00
hmc5843_i2c.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
hmc5843_spi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Kconfig iio: hid-sensors: select IIO_TRIGGERED_BUFFER under HID_SENSOR_IIO_TRIGGER 2021-05-10 14:01:48 +01:00
mag3110.c iio:magnetometer:mag3110: Fix alignment and data leak issues. 2020-12-03 19:40:27 +00:00
Makefile iio: magnetometer: Add driver for Yamaha YAS530 2021-01-09 21:52:46 +00:00
mmc35240.c iio: magnetometer: mmc35240: Fix function header formatting 2020-07-20 09:03:08 +01:00
rm3100-core.c iio: magn: rm3100: Fix alignment of buffer in iio_push_to_buffers_with_timestamp() 2021-06-14 11:42:41 +01:00
rm3100-i2c.c iio: magnetometer: Add driver support for PNI RM3100 2018-11-16 18:32:31 +00:00
rm3100-spi.c iio: magnetometer: Add driver support for PNI RM3100 2018-11-16 18:32:31 +00:00
rm3100.h iio: magnetometer: Add driver support for PNI RM3100 2018-11-16 18:32:31 +00:00
st_magn.h iio: magn: st_magn: use devm_iio_triggered_buffer_setup() for buffer 2021-07-24 16:35:05 +01:00
st_magn_buffer.c iio: magn: st_magn: use devm_iio_triggered_buffer_setup() for buffer 2021-07-24 16:35:05 +01:00
st_magn_core.c iio: magn: st_magn: use devm_iio_triggered_buffer_setup() for buffer 2021-07-24 16:35:05 +01:00
st_magn_i2c.c iio: st_sensors: disable regulators after device unregistration 2021-11-18 19:16:46 +01:00
st_magn_spi.c iio: st_sensors: disable regulators after device unregistration 2021-11-18 19:16:46 +01:00
yamaha-yas530.c iio: Drop Duplicated "mount-matrix" parameter 2021-06-03 18:24:13 +01:00