* [PATCH] iio: accel: adis16201: Use IIO_VAL_INT for temperature scale
@ 2025-04-21 12:28 Gabriel Shahrouzi
2025-04-21 12:33 ` Gabriel Shahrouzi
2025-04-21 14:05 ` Jonathan Cameron
0 siblings, 2 replies; 5+ messages in thread
From: Gabriel Shahrouzi @ 2025-04-21 12:28 UTC (permalink / raw)
To: gregkh, jic23, lars, linux-iio, linux-kernel, Michael.Hennerich
Cc: gshahrouzi, skhan, linux-kernel-mentees, stable
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.
Fixes: cf96ffd8c2ed ("staging:iio:accel:adis16201 move to chan_spec based setup.")
Cc: stable@vger.kernel.org
Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.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;
- return IIO_VAL_INT_PLUS_MICRO;
+ return IIO_VAL_INT;
case IIO_ACCEL:
/*
* IIO base unit for sensitivity of accelerometer
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: accel: adis16201: Use IIO_VAL_INT for temperature scale
2025-04-21 12:28 [PATCH] iio: accel: adis16201: Use IIO_VAL_INT for temperature scale Gabriel Shahrouzi
@ 2025-04-21 12:33 ` Gabriel Shahrouzi
2025-04-21 13:16 ` Greg KH
2025-04-21 14:05 ` Jonathan Cameron
1 sibling, 1 reply; 5+ messages in thread
From: Gabriel Shahrouzi @ 2025-04-21 12:33 UTC (permalink / raw)
To: jic23, lars, linux-iio, linux-kernel, Michael.Hennerich, Greg KH
Cc: skhan, linux-kernel-mentees, stable
Not sure this is worth mentioning but one of the emails from using
get_maintainer.pl on the patch listed a deprecated email:
gregkh@suse.de.
On Mon, Apr 21, 2025 at 8:28 AM Gabriel Shahrouzi <gshahrouzi@gmail.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.
>
> Fixes: cf96ffd8c2ed ("staging:iio:accel:adis16201 move to chan_spec based setup.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.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;
> - return IIO_VAL_INT_PLUS_MICRO;
> + return IIO_VAL_INT;
> case IIO_ACCEL:
> /*
> * IIO base unit for sensitivity of accelerometer
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: accel: adis16201: Use IIO_VAL_INT for temperature scale
2025-04-21 12:33 ` Gabriel Shahrouzi
@ 2025-04-21 13:16 ` Greg KH
2025-04-21 13:30 ` Gabriel Shahrouzi
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2025-04-21 13:16 UTC (permalink / raw)
To: Gabriel Shahrouzi
Cc: jic23, lars, linux-iio, linux-kernel, Michael.Hennerich, skhan,
linux-kernel-mentees, stable
On Mon, Apr 21, 2025 at 08:33:00AM -0400, Gabriel Shahrouzi wrote:
> Not sure this is worth mentioning but one of the emails from using
> get_maintainer.pl on the patch listed a deprecated email:
> gregkh@suse.de.
How? Doesn't do that for me:
> > drivers/iio/accel/adis16201.c | 2 +-
$ ./scripts/get_maintainer.pl drivers/iio/accel/adis16201.c
Lars-Peter Clausen <lars@metafoo.de> (maintainer:ANALOG DEVICES INC IIO DRIVERS)
Michael Hennerich <Michael.Hennerich@analog.com> (maintainer:ANALOG DEVICES INC IIO DRIVERS)
Jonathan Cameron <jic23@kernel.org> (maintainer:IIO SUBSYSTEM AND DRIVERS)
linux-iio@vger.kernel.org (open list:IIO SUBSYSTEM AND DRIVERS)
linux-kernel@vger.kernel.org (open list)
ANALOG DEVICES INC IIO DRIVERS status: Supported
How did you run this?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: accel: adis16201: Use IIO_VAL_INT for temperature scale
2025-04-21 13:16 ` Greg KH
@ 2025-04-21 13:30 ` Gabriel Shahrouzi
0 siblings, 0 replies; 5+ messages in thread
From: Gabriel Shahrouzi @ 2025-04-21 13:30 UTC (permalink / raw)
To: Greg KH
Cc: jic23, lars, linux-iio, linux-kernel, Michael.Hennerich, skhan,
linux-kernel-mentees, stable
On Mon, Apr 21, 2025 at 9:16 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Mon, Apr 21, 2025 at 08:33:00AM -0400, Gabriel Shahrouzi wrote:
> > Not sure this is worth mentioning but one of the emails from using
> > get_maintainer.pl on the patch listed a deprecated email:
> > gregkh@suse.de.
>
> How? Doesn't do that for me:
>
> > > drivers/iio/accel/adis16201.c | 2 +-
>
> $ ./scripts/get_maintainer.pl drivers/iio/accel/adis16201.c
> Lars-Peter Clausen <lars@metafoo.de> (maintainer:ANALOG DEVICES INC IIO DRIVERS)
> Michael Hennerich <Michael.Hennerich@analog.com> (maintainer:ANALOG DEVICES INC IIO DRIVERS)
> Jonathan Cameron <jic23@kernel.org> (maintainer:IIO SUBSYSTEM AND DRIVERS)
> linux-iio@vger.kernel.org (open list:IIO SUBSYSTEM AND DRIVERS)
> linux-kernel@vger.kernel.org (open list)
> ANALOG DEVICES INC IIO DRIVERS status: Supported
>
> How did you run this?
I ran it on the patch: get_maintainer.pl
0001-iio-accel-adis16201-Use-IIO_VAL_INT-for-temperature-.patch
Lars-Peter Clausen <lars@metafoo.de> (maintainer:ANALOG DEVICES INC IIO DRIVERS)
Michael Hennerich <Michael.Hennerich@analog.com> (maintainer:ANALOG
DEVICES INC IIO DRIVERS)
Jonathan Cameron <jic23@kernel.org> (maintainer:IIO SUBSYSTEM AND
DRIVERS,blamed_fixes:1/1=100%)
Greg Kroah-Hartman <gregkh@suse.de> (blamed_fixes:1/1=100%)
linux-iio@vger.kernel.org (open list:IIO SUBSYSTEM AND DRIVERS)
linux-kernel@vger.kernel.org (open list)
ANALOG DEVICES INC IIO DRIVERS status: Supported
Running it only on the file the patch modifies gives the same result
that you got.
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: accel: adis16201: Use IIO_VAL_INT for temperature scale
2025-04-21 12:28 [PATCH] iio: accel: adis16201: Use IIO_VAL_INT for temperature scale Gabriel Shahrouzi
2025-04-21 12:33 ` Gabriel Shahrouzi
@ 2025-04-21 14:05 ` Jonathan Cameron
1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2025-04-21 14:05 UTC (permalink / raw)
To: Gabriel Shahrouzi
Cc: gregkh, lars, linux-iio, linux-kernel, Michael.Hennerich, skhan,
linux-kernel-mentees, stable
On Mon, 21 Apr 2025 08:28:19 -0400
Gabriel Shahrouzi <gshahrouzi@gmail.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@vger.kernel.org
> Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-04-21 14:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-21 12:28 [PATCH] iio: accel: adis16201: Use IIO_VAL_INT for temperature scale Gabriel Shahrouzi
2025-04-21 12:33 ` Gabriel Shahrouzi
2025-04-21 13:16 ` Greg KH
2025-04-21 13:30 ` Gabriel Shahrouzi
2025-04-21 14:05 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®