linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: health: afe4404: retrieve a valid iio_dev in suspend/resume
@ 2017-01-15  3:52 Alison Schofield
  2017-01-21 13:13 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Alison Schofield @ 2017-01-15  3:52 UTC (permalink / raw)
  To: jic23; +Cc: afd, knaack.h, lars, pmeerw, linux-iio, linux-kernel

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: health: afe4404: retrieve a valid iio_dev in suspend/resume
  2017-01-15  3:52 [PATCH] iio: health: afe4404: retrieve a valid iio_dev in suspend/resume Alison Schofield
@ 2017-01-21 13:13 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2017-01-21 13:13 UTC (permalink / raw)
  To: Alison Schofield; +Cc: afd, knaack.h, lars, pmeerw, linux-iio, linux-kernel

On 15/01/17 03:52, Alison Schofield wrote:
> 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>
Applied with Andrew's Ack.
> ---
>  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;
>  
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-21 13:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-15  3:52 [PATCH] iio: health: afe4404: retrieve a valid iio_dev in suspend/resume Alison Schofield
2017-01-21 13:13 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).