linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shubhrajyoti Datta <omaplinuxkernel@gmail.com>
To: Peter Meerwald <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org, jic23@kernel.org, lars@metafoo.de
Subject: Re: [PATCH 1/8] iio: fix access to hmc5843 private data
Date: Wed, 9 May 2012 15:29:52 +0530	[thread overview]
Message-ID: <CAM=Q2csFuVULPim9gE8YnVLCDmJDFTuSFPWwrUmM29yR=LpCEQ@mail.gmail.com> (raw)
In-Reply-To: <1336515606-12364-2-git-send-email-pmeerw@pmeerw.net>

Hi Peter,
A minor observation your from and signoff are a little different was
it intended?

On Wed, May 9, 2012 at 3:49 AM, Peter Meerwald <pmeerw@pmeerw.net> wrot=
e:
> From: Peter Meerwald <p.meerwald@bct-electronic.com>
>
> i2c_get_clientdata(client) points to iio_dev, not hmc5843_data; fixes
> issue similar to 62d2feb9803f18c4e3c8a1a2c7e30a54df8a1d72
>
Looks good to me ack.

> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
> ---
> =A0drivers/staging/iio/magnetometer/hmc5843.c | =A0 14 +++++++++-----
> =A01 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/sta=
ging/iio/magnetometer/hmc5843.c
> index 3ec6518..9725cf8 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843.c
> @@ -250,7 +250,8 @@ static IIO_DEVICE_ATTR(operating_mode,
> =A0static s32 hmc5843_set_meas_conf(struct i2c_client *client,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0u8 meas_conf)
> =A0{
> - =A0 =A0 =A0 struct hmc5843_data *data =3D i2c_get_clientdata(client=
);
> + =A0 =A0 =A0 struct iio_dev *indio_dev =3D i2c_get_clientdata(client=
);
> + =A0 =A0 =A0 struct hmc5843_data *data =3D iio_priv(indio_dev);
> =A0 =A0 =A0 =A0u8 reg_val;
> =A0 =A0 =A0 =A0reg_val =3D (meas_conf & MEAS_CONF_MASK) | =A0(data->r=
ate << RATE_OFFSET);
> =A0 =A0 =A0 =A0return i2c_smbus_write_byte_data(client, HMC5843_CONFI=
G_REG_A, reg_val);
> @@ -272,7 +273,7 @@ static ssize_t hmc5843_set_measurement_configurat=
ion(struct device *dev,
> =A0{
> =A0 =A0 =A0 =A0struct iio_dev *indio_dev =3D dev_get_drvdata(dev);
> =A0 =A0 =A0 =A0struct i2c_client *client =3D to_i2c_client(indio_dev-=
>dev.parent);
> - =A0 =A0 =A0 struct hmc5843_data *data =3D i2c_get_clientdata(client=
);
> + =A0 =A0 =A0 struct hmc5843_data *data =3D iio_priv(indio_dev);
> =A0 =A0 =A0 =A0unsigned long meas_conf =3D 0;
> =A0 =A0 =A0 =A0int error =3D strict_strtoul(buf, 10, &meas_conf);
> =A0 =A0 =A0 =A0if (error)
> @@ -314,7 +315,8 @@ static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("0.5 1 2 5 =
10 20 50");
> =A0static s32 hmc5843_set_rate(struct i2c_client *client,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0u8 rat=
e)
> =A0{
> - =A0 =A0 =A0 struct hmc5843_data *data =3D i2c_get_clientdata(client=
);
> + =A0 =A0 =A0 struct iio_dev *indio_dev =3D i2c_get_clientdata(client=
);
> + =A0 =A0 =A0 struct hmc5843_data *data =3D iio_priv(indio_dev);
> =A0 =A0 =A0 =A0u8 reg_val;
>
> =A0 =A0 =A0 =A0reg_val =3D (data->meas_conf) | =A0(rate << RATE_OFFSE=
T);
> @@ -600,8 +602,10 @@ static int hmc5843_suspend(struct device *dev)
>
> =A0static int hmc5843_resume(struct device *dev)
> =A0{
> - =A0 =A0 =A0 struct hmc5843_data *data =3D i2c_get_clientdata(to_i2c=
_client(dev));
> - =A0 =A0 =A0 hmc5843_configure(to_i2c_client(dev), data->operating_m=
ode);
> + =A0 =A0 =A0 struct i2c_client *client =3D to_i2c_client(dev);
> + =A0 =A0 =A0 struct iio_dev *indio_dev =3D i2c_get_clientdata(client=
);
> + =A0 =A0 =A0 struct hmc5843_data *data =3D iio_priv(indio_dev);
> + =A0 =A0 =A0 hmc5843_configure(client, data->operating_mode);
> =A0 =A0 =A0 =A0return 0;
> =A0}
>
> --
> 1.7.5.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" =
in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-05-09  9:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-08 22:19 iio: v2, add support for HMC5883/HMC5883L to HMC5843 driver Peter Meerwald
2012-05-08 22:19 ` [PATCH 1/8] iio: fix access to hmc5843 private data Peter Meerwald
2012-05-09  9:59   ` Shubhrajyoti Datta [this message]
2012-05-10 14:19     ` Shubhrajyoti Datta
2012-05-10  9:10   ` Jonathan Cameron
2012-05-10 13:18     ` Peter Meerwald
2012-05-08 22:20 ` [PATCH 2/8] iio: change strict_strtoul() to kstrtoul() in hmc5843 Peter Meerwald
2012-05-10  9:11   ` Jonathan Cameron
2012-05-08 22:20 ` [PATCH 3/8] iio: rename and prefix CONSTANTs to distinguish between HMC5843 and HMC5883 Peter Meerwald
2012-05-10 12:11   ` Jonathan Cameron
2012-05-08 22:20 ` [PATCH 4/8] iio: rework sampling rate setting in hmc5843 Peter Meerwald
2012-05-10 12:13   ` Jonathan Cameron
2012-05-08 22:20 ` [PATCH 5/8] iio: add check for measurement configuration value passed to hmc5843 Peter Meerwald
2012-05-10 12:15   ` Jonathan Cameron
2012-05-08 22:20 ` [PATCH 6/8] iio: cleanup and move comments in hmc5843 Peter Meerwald
2012-05-10 12:18   ` Jonathan Cameron
2012-05-08 22:20 ` [PATCH 7/8] iio: rename function/data to consistently start with hmc5843_ Peter Meerwald
2012-05-10 12:18   ` Jonathan Cameron
2012-05-08 22:20 ` [PATCH 8/8] iio: add support for hmc5883/hmc5883l to hmc5843 magnetometer driver Peter Meerwald
2012-05-10 12:29   ` Jonathan Cameron
2012-05-09  9:55 ` iio: v2, add support for HMC5883/HMC5883L to HMC5843 driver Shubhrajyoti Datta
2012-05-09 13:33   ` Peter Meerwald
2012-05-09 14:20     ` 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='CAM=Q2csFuVULPim9gE8YnVLCDmJDFTuSFPWwrUmM29yR=LpCEQ@mail.gmail.com' \
    --to=omaplinuxkernel@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --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).