From: Jacopo Mondi <jacopo@jmondi.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
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: Tue, 6 Aug 2019 09:31:14 +0200 [thread overview]
Message-ID: <20190806073114.4mujzdvbrgxivizs@uno.localdomain> (raw)
In-Reply-To: <20190805181244.663585ac@archlinux>
[-- Attachment #1: Type: text/plain, Size: 1823 bytes --]
Hi Jonathan,
On Mon, Aug 05, 2019 at 06:12:44PM +0100, Jonathan Cameron wrote:
> 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.
>
Indeed, I should have mentioned this patch depends on Joe's
ae8cc91a7d85 ("iio: adc: max9611: Fix misuse of GENMASK macro")
which is now in linux-next, otherwise it might atually trigger errors
due to the wrong mask value.
I wonder if there's a way to keep track of these dependencies for the
sake of backporting, or it's an operation that has to be carried out
manually...
Thanks
j
>
> > ---
> > 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
> >
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-08-06 7:29 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
2019-08-06 7:31 ` Jacopo Mondi [this message]
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=20190806073114.4mujzdvbrgxivizs@uno.localdomain \
--to=jacopo@jmondi.org \
--cc=jacopo+renesas@jmondi.org \
--cc=jic23@kernel.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).