[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250421150451.118e9c95@jic23-huawei>
Date: Mon, 21 Apr 2025 15:05:29 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Gabriel Shahrouzi <gshahrouzi@...il.com>
Cc: gregkh@...e.de, lars@...afoo.de, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org, Michael.Hennerich@...log.com,
skhan@...uxfoundation.org, linux-kernel-mentees@...ts.linux.dev,
stable@...r.kernel.org
Subject: Re: [PATCH] iio: accel: adis16201: Use IIO_VAL_INT for temperature
scale
On Mon, 21 Apr 2025 08:28:19 -0400
Gabriel Shahrouzi <gshahrouzi@...il.com> wrote:
> This is a leftover from the patch: commit cf96ffd8c2ed
> ("staging:iio:accel:adis16201 move to chan_spec based setup.").
> Initially *val = 0 and *val2 = -470000. However, they were later
> changed to -470 and 0 respectively but their return type was not
> updated.
>
> Use correct type as -470 is an integer in the base units.
It's not a fix as such.
We'll get a string that is -470.000000
There was no need to print the .000000 but it also does no harm and
generic userspace will always treat this as a float anyway as most
scale values are.
I don't mind this as a minor improvement patch however.
One comment inline.
Jonathan
>
> Fixes: cf96ffd8c2ed ("staging:iio:accel:adis16201 move to chan_spec based setup.")
> Cc: stable@...r.kernel.org
> Signed-off-by: Gabriel Shahrouzi <gshahrouzi@...il.com>
> ---
> drivers/iio/accel/adis16201.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/adis16201.c b/drivers/iio/accel/adis16201.c
> index dcc8d9f2ee0f1..1f27386edcc4e 100644
> --- a/drivers/iio/accel/adis16201.c
> +++ b/drivers/iio/accel/adis16201.c
> @@ -125,7 +125,7 @@ static int adis16201_read_raw(struct iio_dev *indio_dev,
> case IIO_TEMP:
> *val = -470;
> *val2 = 0;
If we are returning IIO_VAL_INT there is no need to set *val2 as it
is never used.
> - return IIO_VAL_INT_PLUS_MICRO;
> + return IIO_VAL_INT;
> case IIO_ACCEL:
> /*
> * IIO base unit for sensitivity of accelerometer
Powered by blists - more mailing lists