Skip to content

Commit 802ecfc

Browse files
AlisonSchofieldjic23
authored andcommitted
iio: health: afe4404: 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 i2c 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 a5badd1 commit 802ecfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iio/health/afe4404.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ MODULE_DEVICE_TABLE(of, afe4404_of_match);
428428

429429
static int __maybe_unused afe4404_suspend(struct device *dev)
430430
{
431-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
431+
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
432432
struct afe4404_data *afe = iio_priv(indio_dev);
433433
int ret;
434434

@@ -449,7 +449,7 @@ static int __maybe_unused afe4404_suspend(struct device *dev)
449449

450450
static int __maybe_unused afe4404_resume(struct device *dev)
451451
{
452-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
452+
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
453453
struct afe4404_data *afe = iio_priv(indio_dev);
454454
int ret;
455455

0 commit comments

Comments
 (0)