linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@cam.ac.uk>,
	linux-iio@vger.kernel.org, drivers@analog.com
Subject: Re: [PATCH 1/2] staging:iio:adt7410: Fix adt7410_set_mode return value
Date: Wed, 31 Oct 2012 10:50:20 +0000	[thread overview]
Message-ID: <5091026C.6070200@kernel.org> (raw)
In-Reply-To: <1350898942-29586-1-git-send-email-lars@metafoo.de>

On 10/22/2012 10:42 AM, Lars-Peter Clausen wrote:
> The function is expected to return the number of bytes consumed and as long as
> not all bytes have been consumed the function will be called again. Currently
> the function returns 'ret', which will always be 0 in this case, so we end up in
> a endless loop since the caller will assume that no bytes have been consumed. So
> instead return len as it is supposed to.

> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Added to fixes-togreg branch of iio.git

> ---
>  drivers/staging/iio/adc/adt7410.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/adc/adt7410.c b/drivers/staging/iio/adc/adt7410.c
> index 4157596..3cf5103 100644
> --- a/drivers/staging/iio/adc/adt7410.c
> +++ b/drivers/staging/iio/adc/adt7410.c
> @@ -190,7 +190,7 @@ static ssize_t adt7410_store_mode(struct device *dev,
>  
>  	chip->config = config;
>  
> -	return ret;
> +	return len;
>  }
>  
>  static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR,
> 

      parent reply	other threads:[~2012-10-31 10:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22  9:42 [PATCH 1/2] staging:iio:adt7410: Fix adt7410_set_mode return value Lars-Peter Clausen
2012-10-22  9:42 ` [PATCH 2/2] staging:iio: Consolidate adt7310 and adt7410 driver Lars-Peter Clausen
2012-10-31 10:51   ` Jonathan Cameron
2012-10-31 10:50 ` 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=5091026C.6070200@kernel.org \
    --to=jic23@kernel.org \
    --cc=drivers@analog.com \
    --cc=jic23@cam.ac.uk \
    --cc=lars@metafoo.de \
    --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;
as well as URLs for NNTP newsgroup(s).