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


Groups > linux.kernel > #1564116

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

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Jonathan Cameron <jic23@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] iio: health: afe4404: retrieve a valid iio_dev in suspend/resume
Date Sat, 21 Jan 2017 14:20:02 +0100
Message-ID <t23Ki-4sh-11@gated-at.bofh.it> (permalink)
References <sZK94-63T-3@gated-at.bofh.it>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 34
Organization linux.* mail to news gateway
X-Original-Cc afd@ti.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Sat, 21 Jan 2017 13:13:43 +0000
X-Original-Message-ID <921be868-529b-bac2-dbca-f1a8ad943cf7@kernel.org>
X-Original-References <20170115035241.GA19555@d830.WORKGROUP>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1564116

Show key headers only | View raw


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;
>  
> 

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] iio: health: afe4404: retrieve a valid iio_dev in  suspend/resume Jonathan Cameron <jic23@kernel.org> - 2017-01-21 14:20 +0100

csiph-web