lkml.org 
[lkml]   [2019]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] iio: adc: max9611: Fix temperature reading in probe
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
>

\
 
 \ /
  Last update: 2019-08-05 19:13    [W:1.124 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site