From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
Stable@vger.kernel.org,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Sasha Levin <sashal@kernel.org>,
linux-iio@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 02/12] iio: adc: max9611: Fix temperature reading in probe
Date: Tue, 20 Aug 2019 09:42:43 -0400 [thread overview]
Message-ID: <20190820134253.11562-2-sashal@kernel.org> (raw)
In-Reply-To: <20190820134253.11562-1-sashal@kernel.org>
From: Jacopo Mondi <jacopo+renesas@jmondi.org>
[ Upstream commit b9ddd5091160793ee9fac10da765cf3f53d2aaf0 ]
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>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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 f8f298c33b287..c61fbf5602718 100644
--- a/drivers/iio/adc/max9611.c
+++ b/drivers/iio/adc/max9611.c
@@ -484,7 +484,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.20.1
next prev parent reply other threads:[~2019-08-20 13:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-20 13:42 [PATCH AUTOSEL 4.14 01/12] dmaengine: ste_dma40: fix unneeded variable warning Sasha Levin
2019-08-20 13:42 ` Sasha Levin [this message]
2019-08-20 13:42 ` [PATCH AUTOSEL 4.14 03/12] auxdisplay: panel: need to delete scan_timer when misc_register fails in panel_attach Sasha Levin
2019-08-20 13:42 ` [PATCH AUTOSEL 4.14 04/12] iommu/dma: Handle SG length overflow better Sasha Levin
2019-08-20 13:42 ` [PATCH AUTOSEL 4.14 05/12] usb: gadget: composite: Clear "suspended" on reset/disconnect Sasha Levin
2019-08-20 13:42 ` [PATCH AUTOSEL 4.14 06/12] usb: gadget: mass_storage: Fix races between fsg_disable and fsg_set_alt Sasha Levin
2019-08-20 13:42 ` [PATCH AUTOSEL 4.14 07/12] xen/blkback: fix memory leaks Sasha Levin
2019-08-20 13:42 ` [PATCH AUTOSEL 4.14 08/12] i2c: rcar: avoid race when unregistering slave client Sasha Levin
2019-08-20 13:42 ` [PATCH AUTOSEL 4.14 09/12] i2c: emev2: " Sasha Levin
2019-08-20 13:42 ` [PATCH AUTOSEL 4.14 10/12] drm/ast: Fixed reboot test may cause system hanged Sasha Levin
2019-08-20 13:42 ` [PATCH AUTOSEL 4.14 11/12] usb: host: fotg2: restart hcd after port reset Sasha Levin
2019-08-20 13:42 ` [PATCH AUTOSEL 4.14 12/12] tools: hv: fix KVP and VSS daemons exit code Sasha Levin
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=20190820134253.11562-2-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=jacopo+renesas@jmondi.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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).