From: Jonathan Cameron <jic23@kernel.org>
To: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Stefan Agner <stefan@agner.ch>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: max9611: Fix temperature reading in probe
Date: Mon, 5 Aug 2019 18:12:44 +0100 [thread overview]
Message-ID: <20190805181244.663585ac@archlinux> (raw)
In-Reply-To: <20190805155515.22621-1-jacopo+renesas@jmondi.org>
On Mon, 5 Aug 2019 17:55:15 +0200
Jacopo Mondi <jacopo+renesas@jmondi.org> wrote:
> The max9611 driver reads the die temperature at probe time to validate
> the communication channel. Use the actual read value to perform the test
> instead of the read function return value, which was mistakenly used so
> far.
>
> The temperature reading test was only successful because the 0 return
> value is in the range of supported temperatures.
>
> Fixes: 69780a3bbc0b ("iio: adc: Add Maxim max9611 ADC driver")
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Applied to the fixes-togreg branch of iio.git and marked for
stable. That'll be a bit fiddly given other changes around this
so we may need to do backports.
> ---
> drivers/iio/adc/max9611.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c
> index 917223d5ff5b..e9f6b1da1b94 100644
> --- a/drivers/iio/adc/max9611.c
> +++ b/drivers/iio/adc/max9611.c
> @@ -480,7 +480,7 @@ static int max9611_init(struct max9611_dev *max9611)
> if (ret)
> return ret;
>
> - regval = ret & MAX9611_TEMP_MASK;
> + regval &= MAX9611_TEMP_MASK;
>
> if ((regval > MAX9611_TEMP_MAX_POS &&
> regval < MAX9611_TEMP_MIN_NEG) ||
> --
> 2.22.0
>
next prev parent reply other threads:[~2019-08-05 17:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-05 15:55 [PATCH] iio: adc: max9611: Fix temperature reading in probe Jacopo Mondi
2019-08-05 17:12 ` Jonathan Cameron [this message]
2019-08-06 7:31 ` Jacopo Mondi
2019-08-11 8:24 ` Jonathan Cameron
2019-08-21 11:28 ` Geert Uytterhoeven
2019-08-21 12:34 ` Jacopo Mondi
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=20190805181244.663585ac@archlinux \
--to=jic23@kernel.org \
--cc=jacopo+renesas@jmondi.org \
--cc=knaack.h@gmx.de \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=stefan@agner.ch \
/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).