All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alison Schofield <amsfield22@gmail.com>
To: Gargi Sharma <gs051095@gmail.com>
Cc: outreachy-kernel@googlegroups.com,
	arushisinghal19971997@gmail.com, singhalsimran0@gmail.com,
	karniksayli1995@gmail.com
Subject: Re: [PATCH] Proposal for meter ade* patches
Date: Sat, 25 Mar 2017 08:43:46 -0700	[thread overview]
Message-ID: <20170325154345.GA1750@d830.WORKGROUP> (raw)
In-Reply-To: <1490427900-21479-1-git-send-email-gs051095@gmail.com>

On Sat, Mar 25, 2017 at 01:15:00PM +0530, Gargi Sharma wrote:
> The driver needs to insure atomicity during frequency
> changes of bus and device. The iiodev->mlock as used
> was not doing that. Replace it with the drivers existing
> buffer lock and execute spi_write directly.
> 
> Signed-off-by: Gargi Sharma <gs051095@gmail.com>

Hi Gargi,

It's certainly a clean, simple patch!  It's good that you're 
running it by Sayli, Simran, and Arushi.  Some consensus that
this flavor of fix will work in their drivers would be good
before forwarding it on for 'official' review.

An RFC tag might have been appropriate here, but no worries
now.  It's only in our Outreachy tree.

alisons

> ---
>  drivers/staging/iio/meter/ade7754.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c
> index c8d2d4c..48339e9a 100644
> --- a/drivers/staging/iio/meter/ade7754.c
> +++ b/drivers/staging/iio/meter/ade7754.c
> @@ -513,7 +513,7 @@ static ssize_t ade7754_write_frequency(struct device *dev,
>  	if (!val)
>  		return -EINVAL;
>  
> -	mutex_lock(&indio_dev->mlock);
> +	mutex_lock(&st->buf_lock);
>  
>  	t = 26000 / val;
>  	if (t > 0)
> @@ -531,10 +531,13 @@ static ssize_t ade7754_write_frequency(struct device *dev,
>  	reg &= ~(3 << 3);
>  	reg |= t << 3;
>  
> -	ret = ade7754_spi_write_reg_8(dev, ADE7754_WAVMODE, reg);
> +	st->tx[0] = ADE7754_WRITE_REG(ADE7754_WAVMODE);
> +	st->tx[1] = reg;
> +
> +	ret = spi_write(st->us, st->tx, 2);
>  
>  out:
> -	mutex_unlock(&indio_dev->mlock);
> +	mutex_unlock(&st->buf_lock);
>  
>  	return ret ? ret : len;
>  }
> -- 
> 2.7.4
> 


      reply	other threads:[~2017-03-25 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-25  7:45 [PATCH] Proposal for meter ade* patches Gargi Sharma
2017-03-25 15:43 ` Alison Schofield [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=20170325154345.GA1750@d830.WORKGROUP \
    --to=amsfield22@gmail.com \
    --cc=arushisinghal19971997@gmail.com \
    --cc=gs051095@gmail.com \
    --cc=karniksayli1995@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=singhalsimran0@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.