Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1559158 > unrolled thread

[PATCH] iio: health: afe4404: retrieve a valid iio_dev in suspend/resume

Started byAlison Schofield <amsfield22@gmail.com>
First post2017-01-15 05:00 +0100
Last post2017-01-15 05:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] iio: health: afe4404: retrieve a valid iio_dev in  suspend/resume Alison Schofield <amsfield22@gmail.com> - 2017-01-15 05:00 +0100

#1559158 — [PATCH] iio: health: afe4404: retrieve a valid iio_dev in suspend/resume

FromAlison Schofield <amsfield22@gmail.com>
Date2017-01-15 05:00 +0100
Subject[PATCH] iio: health: afe4404: retrieve a valid iio_dev in suspend/resume
Message-ID<sZK94-63T-3@gated-at.bofh.it>
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 <amsfield22@gmail.com>
---
 drivers/iio/health/afe4404.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/health/afe4404.c b/drivers/iio/health/afe4404.c
index 4526640..964f523 100644
--- a/drivers/iio/health/afe4404.c
+++ b/drivers/iio/health/afe4404.c
@@ -428,7 +428,7 @@ MODULE_DEVICE_TABLE(of, afe4404_of_match);
 
 static int __maybe_unused afe4404_suspend(struct device *dev)
 {
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
+	struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
 	struct afe4404_data *afe = iio_priv(indio_dev);
 	int ret;
 
@@ -449,7 +449,7 @@ static int __maybe_unused afe4404_suspend(struct device *dev)
 
 static int __maybe_unused afe4404_resume(struct device *dev)
 {
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
+	struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
 	struct afe4404_data *afe = iio_priv(indio_dev);
 	int ret;
 
-- 
2.1.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web