kernel_optimize_test/drivers/iio/pressure
Alexandru Ardelean a2c17c93b7 iio: st_sensors: disable regulators after device unregistration
[ Upstream commit 9f0b3e0cc0c88618aa9e5cecef747b1337ae0a5d ]

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 14:04:13 +01:00
..
abp060mg.c
bmp280-core.c
bmp280-i2c.c
bmp280-regmap.c
bmp280-spi.c
bmp280.h
cros_ec_baro.c
dlhl60d.c
dps310.c
hid-sensor-press.c
hp03.c
hp206c.c
icp10100.c
Kconfig
Makefile
mpl115_i2c.c
mpl115_spi.c
mpl115.c
mpl115.h
mpl3115.c
ms5611_core.c
ms5611_i2c.c
ms5611_spi.c
ms5611.h
ms5637.c
st_pressure_buffer.c
st_pressure_core.c
st_pressure_i2c.c iio: st_sensors: disable regulators after device unregistration 2021-11-18 14:04:13 +01:00
st_pressure_spi.c iio: st_sensors: disable regulators after device unregistration 2021-11-18 14:04:13 +01:00
st_pressure.h
t5403.c
zpa2326_i2c.c
zpa2326_spi.c
zpa2326.c
zpa2326.h