summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-12-24 04:17:00 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-02-21 19:17:10 +0300
commit4f5434086d9223f20b3128a7dc78b35271e76655 (patch)
treeaef9e3e499b471f6ae49093f647b0e6d58a67445
parent121875b28e3bd7519a675bf8ea2c2e793452c2bd (diff)
downloadlinux-4f5434086d9223f20b3128a7dc78b35271e76655.tar.xz
iio: adc: ab8500-gpadc: Fix off by 10 to 3
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 <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20201224011700.1059659-1-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/adc/ab8500-gpadc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/ab8500-gpadc.c b/drivers/iio/adc/ab8500-gpadc.c
index 1bb987a4acba..8d81505282dd 100644
--- 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 iio_dev *indio_dev,
return processed;
/* Return millivolt or milliamps or millicentigrades */
- *val = processed * 1000;
+ *val = processed;
return IIO_VAL_INT;
}