Skip to content

Commit b9ddd50

Browse files
Jacopo Mondijic23
authored andcommitted
iio: adc: max9611: Fix temperature reading in probe
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: 69780a3 ("iio: adc: Add Maxim max9611 ADC driver") Signed-off-by: Jacopo Mondi <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 82a5008 commit b9ddd50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/max9611.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ static int max9611_init(struct max9611_dev *max9611)
480480
if (ret)
481481
return ret;
482482

483-
regval = ret & MAX9611_TEMP_MASK;
483+
regval &= MAX9611_TEMP_MASK;
484484

485485
if ((regval > MAX9611_TEMP_MAX_POS &&
486486
regval < MAX9611_TEMP_MIN_NEG) ||

0 commit comments

Comments
 (0)