iio: pressure: bmp280: Fix incorrect pointer access in PM callbacks
PATCH 1/1 iio: pressure: bmp280: Fix incorrect pointer access in PM callbacks
BMP280 runtime PM callbacks are incorrectly casting dev_get_drvdata() to struct bmp280_data * while bmp280_common_probe() sets driver data to struct iio_dev *. Fix this and get the struct bmp280_data * from private data of struct iio_dev.
---
For v4.8-rc.
--- drivers/iio/pressure/bmp280-core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/iio/pressure/bmp280-core.c +4 -2
@@ -1079,7 +1079,8 @@ EXPORT_SYMBOL(bmp280_common_remove);#ifdef CONFIG_PM static int bmp280_runtime_suspend (struct device *dev) { -struct bmp280_data *data =dev_get_drvdata (dev); +struct iio_dev *indio_dev =dev_get_drvdata (dev); +struct bmp280_data *data =iio_priv (indio_dev);int ret; ret =regulator_disable (data->vdda);
@@ -1090,7 +1091,8 @@ static int bmp280_runtime_suspend(struct device *dev)static int bmp280_runtime_resume (struct device *dev) { -struct bmp280_data *data =dev_get_drvdata (dev); +struct iio_dev *indio_dev =dev_get_drvdata (dev); +struct bmp280_data *data =iio_priv (indio_dev);int ret; ret =regulator_enable (data->vddd);
Signature · 1 line
2.8.1
Quoted 9 lines · Jarkko Nikula
BMP280 runtime PM callbacks are incorrectly casting
dev_get_drvdata()to structbmp280_data* whilebmp280_common_probe()sets driver data to structiio_dev*. Fix this and get the structbmp280_data* from private data of structiio_dev.Fixes 3d838118c6aa ("iio: pressure: bmp280: add power management")Signed-off-by Jarkko Nikula <[email protected]>---
For v4.8-rc.
Sent a fix for this already two weeks ago:
http://marc.info/?l=linux-iio&m=146965159217655&w=2
Just waiting for it to be picked up and merged.
Yours,
Linus Walleij
Jarkko Nikula
Tested-byQuoted 13 lines · Linus Walleij
Quoted 9 lines · Jarkko Nikula
BMP280 runtime PM callbacks are incorrectly casting
dev_get_drvdata()to structbmp280_data* whilebmp280_common_probe()sets driver data to structiio_dev*. Fix this and get the structbmp280_data* from private data of structiio_dev.Fixes 3d838118c6aa ("iio: pressure: bmp280: add power management")Signed-off-by Jarkko Nikula <[email protected]>---
For v4.8-rc.
Quoted 5 lines
Sent a fix for this already two weeks ago:
http://marc.info/?l=linux-iio&m=146965159217655&w=2Just waiting for it to be picked up and merged.
Ok, please feel free to add my tested by to your patch then
Jonathan Cameron
maintainerQuoted 14 lines · Jarkko Nikula
Quoted 13 lines · Linus Walleij
Quoted 9 lines · Jarkko Nikula
BMP280 runtime PM callbacks are incorrectly casting
dev_get_drvdata()to structbmp280_data* whilebmp280_common_probe()sets driver data to structiio_dev*. Fix this and get the structbmp280_data* from private data of structiio_dev.Fixes 3d838118c6aa ("iio: pressure: bmp280: add power management")Signed-off-by Jarkko Nikula <[email protected]>---
For v4.8-rc.
Quoted 8 lines
Quoted 5 lines
Sent a fix for this already two weeks ago:
http://marc.info/?l=linux-iio&m=146965159217655&w=2Just waiting for it to be picked up and merged.
Ok, please feel free to add my tested by to your patch then
Tested-by Jarkko Nikula <[email protected]>
Added.