Skip to content

Commit a5badd1

Browse files
AlisonSchofieldjic23
authored andcommitted
iio: health: afe4403: 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. Replace it with spi functions to get the correct iio_dev. Signed-off-by: Alison Schofield <[email protected]> Acked-by: Andrew F. Davis <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent a121103 commit a5badd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iio/health/afe4403.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ MODULE_DEVICE_TABLE(of, afe4403_of_match);
422422

423423
static int __maybe_unused afe4403_suspend(struct device *dev)
424424
{
425-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
425+
struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev));
426426
struct afe4403_data *afe = iio_priv(indio_dev);
427427
int ret;
428428

@@ -443,7 +443,7 @@ static int __maybe_unused afe4403_suspend(struct device *dev)
443443

444444
static int __maybe_unused afe4403_resume(struct device *dev)
445445
{
446-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
446+
struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev));
447447
struct afe4403_data *afe = iio_priv(indio_dev);
448448
int ret;
449449

0 commit comments

Comments
 (0)