Thread (169 messages) 169 messages, 7 authors, 2021-03-24
STALE1948d

[PATCH 5.10 129/157] iio: adc: ab8500-gpadc: Fix off by 10 to 3

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-03-22 12:53:13
Also in: lkml

From: Linus Walleij <redacted>

commit 4f5434086d9223f20b3128a7dc78b35271e76655 upstream.

Fix an off by three orders of magnitude error in the AB8500
GPADC driver. Luckily it showed up quite quickly when trying
to make use of it. The processed reads were returning
microvolts, microamperes and microcelsius instead of millivolts,
milliamperes and millicelsius as advertised.

Cc: stable@vger.kernel.org
Fixes: 07063bbfa98e ("iio: adc: New driver for the AB8500 GPADC")
Signed-off-by: Linus Walleij <redacted>
Link: https://lore.kernel.org/r/20201224011700.1059659-1-linus.walleij@linaro.org (local)
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/iio/adc/ab8500-gpadc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iio/adc/ab8500-gpadc.c
+++ b/drivers/iio/adc/ab8500-gpadc.c
@@ -918,7 +918,7 @@ static int ab8500_gpadc_read_raw(struct
 			return processed;
 
 		/* Return millivolt or milliamps or millicentigrades */
-		*val = processed * 1000;
+		*val = processed;
 		return IIO_VAL_INT;
 	}
 

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help