mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
iio: adc: max9611: Fix temperature reading in probe
commitb9ddd50911upstream. 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:69780a3bbc("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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
beed4c284a
commit
24e808d960
@@ -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) ||
|
||||
|
||||
Reference in New Issue
Block a user