mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Cosmin Tanislav <cosmin.tanislav@analog.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Cosmin Tanislav <demonsingur@gmail.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: addac: ad74413: fix resistance input processing
Date: Thu, 04 May 2023 09:09:52 +0200	[thread overview]
Message-ID: <50a65435aedd208e4980938ed191c2a281c5015e.camel@gmail.com> (raw)
In-Reply-To: <20230503095817.452551-1-linux@rasmusvillemoes.dk>

On Wed, 2023-05-03 at 11:58 +0200, Rasmus Villemoes wrote:
> On success, ad74413r_get_single_adc_result() returns IIO_VAL_INT aka
> 1. So currently, the IIO_CHAN_INFO_PROCESSED case is effectively
> equivalent to the IIO_CHAN_INFO_RAW case, and we never call
> ad74413r_adc_to_resistance_result() to convert the adc measurement to
> ohms.
> 
> Check ret for being negative rather than non-zero.
> 
> Fixes: fea251b6a5dbd (iio: addac: add AD74413R driver)
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---

Reviewed-by: Nuno Sa <nuno.sa@analog.com>

>  drivers/iio/addac/ad74413r.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/addac/ad74413r.c b/drivers/iio/addac/ad74413r.c
> index 07e9f6ae16a8..e3366cf5eb31 100644
> --- a/drivers/iio/addac/ad74413r.c
> +++ b/drivers/iio/addac/ad74413r.c
> @@ -1007,7 +1007,7 @@ static int ad74413r_read_raw(struct iio_dev *indio_dev,
>  
>                 ret = ad74413r_get_single_adc_result(indio_dev, chan->channel,
>                                                      val);
> -               if (ret)
> +               if (ret < 0)
>                         return ret;
>  
>                 ad74413r_adc_to_resistance_result(*val, val);


      reply	other threads:[~2023-05-04  7:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03  9:58 Rasmus Villemoes
2023-05-04  7:09 ` Nuno Sá [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=50a65435aedd208e4980938ed191c2a281c5015e.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=cosmin.tanislav@analog.com \
    --cc=demonsingur@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    /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

all inboxes | Powered by JetHome®