Skip to content

Commit d1aaf20

Browse files
AlisonSchofieldjic23
authored andcommitted
iio: adc: palmas_gpadc: retrieve a valid iio_dev in suspend/resume
The suspend/resume functions were using dev_to_iio_dev() to get the iio_dev. That only works on IIO dev's. Use dev_get_drvdata() for a platform device to get the correct iio_dev. Signed-off-by: Alison Schofield <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 828f84e commit d1aaf20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iio/adc/palmas_gpadc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ static int palmas_adc_wakeup_reset(struct palmas_gpadc *adc)
775775

776776
static int palmas_gpadc_suspend(struct device *dev)
777777
{
778-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
778+
struct iio_dev *indio_dev = dev_get_drvdata(dev);
779779
struct palmas_gpadc *adc = iio_priv(indio_dev);
780780
int wakeup = adc->wakeup1_enable || adc->wakeup2_enable;
781781
int ret;
@@ -798,7 +798,7 @@ static int palmas_gpadc_suspend(struct device *dev)
798798

799799
static int palmas_gpadc_resume(struct device *dev)
800800
{
801-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
801+
struct iio_dev *indio_dev = dev_get_drvdata(dev);
802802
struct palmas_gpadc *adc = iio_priv(indio_dev);
803803
int wakeup = adc->wakeup1_enable || adc->wakeup2_enable;
804804
int ret;

0 commit comments

Comments
 (0)