From: Jonathan Cameron <jic23@kernel.org>
To: Peter Meerwald <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 3/4] iio: Fix mcp4725 dev-to-indio_dev conversion in suspend/resume
Date: Sat, 21 Sep 2013 12:06:54 +0100 [thread overview]
Message-ID: <523D7DCE.6000209@kernel.org> (raw)
In-Reply-To: <1379540853-15189-3-git-send-email-pmeerw@pmeerw.net>
On 09/18/13 22:47, Peter Meerwald wrote:
> dev_to_iio_dev() is a false friend
>
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Applied to the fixes-togreg branch of iio.git
Thanks
> ---
> drivers/iio/dac/mcp4725.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
> index 6711a33..7a42d85 100644
> --- a/drivers/iio/dac/mcp4725.c
> +++ b/drivers/iio/dac/mcp4725.c
> @@ -37,21 +37,21 @@ struct mcp4725_data {
>
> static int mcp4725_suspend(struct device *dev)
> {
> - struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> - struct mcp4725_data *data = iio_priv(indio_dev);
> + struct mcp4725_data *data = iio_priv(i2c_get_clientdata(
> + to_i2c_client(dev)));
> u8 outbuf[2];
>
> outbuf[0] = (data->powerdown_mode + 1) << 4;
> outbuf[1] = 0;
> data->powerdown = true;
>
> - return i2c_master_send(to_i2c_client(dev), outbuf, 2);
> + return i2c_master_send(data->client, outbuf, 2);
> }
>
> static int mcp4725_resume(struct device *dev)
> {
> - struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> - struct mcp4725_data *data = iio_priv(indio_dev);
> + struct mcp4725_data *data = iio_priv(i2c_get_clientdata(
> + to_i2c_client(dev)));
> u8 outbuf[2];
>
> /* restore previous DAC value */
> @@ -59,7 +59,7 @@ static int mcp4725_resume(struct device *dev)
> outbuf[1] = data->dac_value & 0xff;
> data->powerdown = false;
>
> - return i2c_master_send(to_i2c_client(dev), outbuf, 2);
> + return i2c_master_send(data->client, outbuf, 2);
> }
>
> #ifdef CONFIG_PM_SLEEP
>
next prev parent reply other threads:[~2013-09-21 10:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-18 21:47 [PATCH 1/4] iio: Fix tmp006 dev-to-indio_dev conversion in suspend/resume Peter Meerwald
2013-09-18 21:47 ` [PATCH 2/4] iio: Fix bma180 " Peter Meerwald
2013-09-21 11:06 ` Jonathan Cameron
2013-09-18 21:47 ` [PATCH 3/4] iio: Fix mcp4725 " Peter Meerwald
2013-09-21 11:06 ` Jonathan Cameron [this message]
2013-09-18 21:47 ` [PATCH 4/4] iio: Fix tcs3472 " Peter Meerwald
2013-09-21 11:20 ` Jonathan Cameron
2013-09-21 11:05 ` [PATCH 1/4] iio: Fix tmp006 " Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=523D7DCE.6000209@kernel.org \
--to=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).