linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: ab8500-gpadc: Fix off by 10 to 3
@ 2020-12-24  1:17 Linus Walleij
  2021-02-21 16:18 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2020-12-24  1:17 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Linus Walleij, stable

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>
---
 drivers/iio/adc/ab8500-gpadc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ab8500-gpadc.c b/drivers/iio/adc/ab8500-gpadc.c
index 6f9a3e2d5533..7b5212ba5501 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;
 	}
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: adc: ab8500-gpadc: Fix off by 10 to 3
  2020-12-24  1:17 [PATCH] iio: adc: ab8500-gpadc: Fix off by 10 to 3 Linus Walleij
@ 2021-02-21 16:18 ` Jonathan Cameron
  2021-02-22 23:56   ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2021-02-21 16:18 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-iio, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, stable

On Thu, 24 Dec 2020 02:17:00 +0100
Linus Walleij <linus.walleij@linaro.org> wrote:

> 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>
No idea why I didn't pick this up before now.  I guess I forgot it
over xmas.

Anyhow, now applied to the fixes-togreg branch of iio.git.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ab8500-gpadc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ab8500-gpadc.c b/drivers/iio/adc/ab8500-gpadc.c
> index 6f9a3e2d5533..7b5212ba5501 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;
>  	}
>  


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: adc: ab8500-gpadc: Fix off by 10 to 3
  2021-02-21 16:18 ` Jonathan Cameron
@ 2021-02-22 23:56   ` Linus Walleij
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2021-02-22 23:56 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, stable

On Sun, Feb 21, 2021 at 5:18 PM Jonathan Cameron <jic23@kernel.org> wrote:
> On Thu, 24 Dec 2020 02:17:00 +0100
> Linus Walleij <linus.walleij@linaro.org> wrote:

> No idea why I didn't pick this up before now.  I guess I forgot it
> over xmas.
>
> Anyhow, now applied to the fixes-togreg branch of iio.git.

Such things happen, was just gonna poke you about it,
thanks a lot!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-22 23:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24  1:17 [PATCH] iio: adc: ab8500-gpadc: Fix off by 10 to 3 Linus Walleij
2021-02-21 16:18 ` Jonathan Cameron
2021-02-22 23:56   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).