From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v2] iio: gyro: adis16260: replace mlock with ADIS lib's state_lock
Date: Sat, 12 Oct 2019 14:43:50 +0100 [thread overview]
Message-ID: <20191012144350.4e3411c0@archlinux> (raw)
In-Reply-To: <20191008082225.4526-1-alexandru.ardelean@analog.com>
On Tue, 8 Oct 2019 11:22:25 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
> This change uses the ADIS library's state_lock to protect the state of the
> `max_speed_hz` change that is done during the set of the sampling
> frequency.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Looks good.
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.
Thanks,
Jonathan
p.s. personal preference is don't put a new patch version as a reply
to an earlier one. Makes it a lot more likely I'll fail to notice
it!
> ---
>
> Changelog v1 -> v2:
> * use ADIS library's state_lock instead indio_dev's mlock ; vs just
> removing it (as V1 did)
>
> drivers/iio/gyro/adis16260.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/gyro/adis16260.c b/drivers/iio/gyro/adis16260.c
> index 207a0ce13439..726a0aa321a8 100644
> --- a/drivers/iio/gyro/adis16260.c
> +++ b/drivers/iio/gyro/adis16260.c
> @@ -293,7 +293,7 @@ static int adis16260_write_raw(struct iio_dev *indio_dev,
> addr = adis16260_addresses[chan->scan_index][1];
> return adis_write_reg_16(adis, addr, val);
> case IIO_CHAN_INFO_SAMP_FREQ:
> - mutex_lock(&indio_dev->mlock);
> + mutex_lock(&adis->state_lock);
> if (spi_get_device_id(adis->spi)->driver_data)
> t = 256 / val;
> else
> @@ -308,9 +308,9 @@ static int adis16260_write_raw(struct iio_dev *indio_dev,
> adis->spi->max_speed_hz = ADIS16260_SPI_SLOW;
> else
> adis->spi->max_speed_hz = ADIS16260_SPI_FAST;
> - ret = adis_write_reg_8(adis, ADIS16260_SMPL_PRD, t);
> + ret = __adis_write_reg_8(adis, ADIS16260_SMPL_PRD, t);
>
> - mutex_unlock(&indio_dev->mlock);
> + mutex_unlock(&adis->state_lock);
> return ret;
> }
> return -EINVAL;
prev parent reply other threads:[~2019-10-12 13:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-19 11:57 [PATCH] iio: gyro: adis16260: remove indio_dev mlock Alexandru Ardelean
2019-10-05 14:38 ` Jonathan Cameron
2019-10-05 14:49 ` Jonathan Cameron
2019-10-07 7:56 ` Ardelean, Alexandru
2019-10-08 8:22 ` [PATCH v2] iio: gyro: adis16260: replace mlock with ADIS lib's state_lock Alexandru Ardelean
2019-10-12 13:43 ` 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=20191012144350.4e3411c0@archlinux \
--to=jic23@kernel.org \
--cc=alexandru.ardelean@analog.com \
--cc=linux-iio@vger.kernel.org \
/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