From: Jonathan Cameron <jic23@kernel.org>
To: Gargi Sharma <gs051095@gmail.com>, outreachy-kernel@googlegroups.com
Cc: linux-iio@vger.kernel.org, lars@metafoo.de,
Michael.Hennerich@analog.com, knaack.h@gmx.de, pmeerw@pmeerw.net,
gregkh@linuxfoundation.org
Subject: Re: [PATCH] staging: adis16203: Remove locking on raw reads of IIO_CHAN_INFO_CALIBBIAS
Date: Wed, 22 Mar 2017 20:41:50 +0000 [thread overview]
Message-ID: <5940916e-2c48-ec4c-8ed8-8475642582e9@kernel.org> (raw)
In-Reply-To: <1489998642-13796-1-git-send-email-gs051095@gmail.com>
On 20/03/17 08:30, Gargi Sharma wrote:
> adis16203_read_raw does not need lock for IIO_CHAN_INFO_CALIBBIAS
> since adis_read_reg_16 is already atomic and nothing else needs to be
> protected.
>
> Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it. Thanks,
Jonathan
> ---
> drivers/staging/iio/accel/adis16203.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c
> index 68189ad..14fe2d3 100644
> --- a/drivers/staging/iio/accel/adis16203.c
> +++ b/drivers/staging/iio/accel/adis16203.c
> @@ -203,17 +203,14 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
> return IIO_VAL_INT;
> case IIO_CHAN_INFO_CALIBBIAS:
> bits = 14;
> - mutex_lock(&indio_dev->mlock);
> addr = adis16203_addresses[chan->scan_index];
> ret = adis_read_reg_16(st, addr, &val16);
> if (ret) {
> - mutex_unlock(&indio_dev->mlock);
> return ret;
> }
> val16 &= (1 << bits) - 1;
> val16 = (s16)(val16 << (16 - bits)) >> (16 - bits);
> *val = val16;
> - mutex_unlock(&indio_dev->mlock);
> return IIO_VAL_INT;
> default:
> return -EINVAL;
>
prev parent reply other threads:[~2017-03-22 20:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-20 8:30 [PATCH] staging: adis16203: Remove locking on raw reads of IIO_CHAN_INFO_CALIBBIAS Gargi Sharma
2017-03-22 20:41 ` Jonathan Cameron [this message]
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=5940916e-2c48-ec4c-8ed8-8475642582e9@kernel.org \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=gregkh@linuxfoundation.org \
--cc=gs051095@gmail.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=outreachy-kernel@googlegroups.com \
--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).