diff options
| author | Alison Schofield <amsfield22@gmail.com> | 2017-01-16 14:27:52 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-09 02:08:30 -0500 |
| commit | 54d2ccc4003b7ec3378349df62b1642a2a4aa51c (patch) | |
| tree | 85ad2d4aba1fdcb34628850fc534b5533d5dc3bd /drivers/iio | |
| parent | db0e02ef6b821a42f7270ceaa61e800399d0950c (diff) | |
iio: adc: palmas_gpadc: retrieve a valid iio_dev in suspend/resume
commit d1aaf20ee655888c227d5137b7a63551f8d15416 upstream.
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 <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
| -rw-r--r-- | drivers/iio/adc/palmas_gpadc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c index 2bbf0c521beb..7d61b566e148 100644 --- a/drivers/iio/adc/palmas_gpadc.c +++ b/drivers/iio/adc/palmas_gpadc.c | |||
| @@ -775,7 +775,7 @@ static int palmas_adc_wakeup_reset(struct palmas_gpadc *adc) | |||
| 775 | 775 | ||
| 776 | static int palmas_gpadc_suspend(struct device *dev) | 776 | static int palmas_gpadc_suspend(struct device *dev) |
| 777 | { | 777 | { |
| 778 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | 778 | struct iio_dev *indio_dev = dev_get_drvdata(dev); |
| 779 | struct palmas_gpadc *adc = iio_priv(indio_dev); | 779 | struct palmas_gpadc *adc = iio_priv(indio_dev); |
| 780 | int wakeup = adc->wakeup1_enable || adc->wakeup2_enable; | 780 | int wakeup = adc->wakeup1_enable || adc->wakeup2_enable; |
| 781 | int ret; | 781 | int ret; |
| @@ -798,7 +798,7 @@ static int palmas_gpadc_suspend(struct device *dev) | |||
| 798 | 798 | ||
| 799 | static int palmas_gpadc_resume(struct device *dev) | 799 | static int palmas_gpadc_resume(struct device *dev) |
| 800 | { | 800 | { |
| 801 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | 801 | struct iio_dev *indio_dev = dev_get_drvdata(dev); |
| 802 | struct palmas_gpadc *adc = iio_priv(indio_dev); | 802 | struct palmas_gpadc *adc = iio_priv(indio_dev); |
| 803 | int wakeup = adc->wakeup1_enable || adc->wakeup2_enable; | 803 | int wakeup = adc->wakeup1_enable || adc->wakeup2_enable; |
| 804 | int ret; | 804 | int ret; |
