Skip to contentSkip to conversation

iio: accel: adis16203: cleanup and standardization

PATCH In review Siddharth Menon 2 participants 7 messages Mar 5, 2025 – Mar 9, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover iio: accel: adis16203: cleanup and standardization

This series improves the adis16203 driver by using standard unit macros and removing an unused spi_set_drvdata() call.

Siddharth Menon (2):
iio: accel: adis16203: Use units.h macros for voltage values
iio: accel: adis16203: Remove spi_set_drvdata()

 drivers/staging/iio/accel/adis16203.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
Signature · 1 line
2.48.1
#1 lore raw

PATCH 1/2 iio: accel: adis16203: Use units.h macros for measurements

Replace hardcoded microvolt and degree values with MILLI macros from linux/units.h. Also fixed typo in comment (1.22mV->0.22mV).

---
 drivers/staging/iio/accel/adis16203.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/staging/iio/accel/adis16203.c +4 -3
index c1c73308800c..ac4b28bcd766 100644
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/spi/spi.h>
+#include <linux/units.h>
 
 #define ADIS16203_STARTUP_DELAY 220 /* ms */
 
@@ -173,10 +174,10 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
 		case IIO_VOLTAGE:
 			if (chan->channel == 0) {
 				*val = 1;
-				*val2 = 220000; /* 1.22 mV */
+				*val2 = 220 * MILLI; /* 0.22 mV */
 			} else {
 				*val = 0;
-				*val2 = 610000; /* 0.61 mV */
+				*val2 = 610 * MILLI; /* 0.61 mV */
 			}
 			return IIO_VAL_INT_PLUS_MICRO;
 		case IIO_TEMP:
@@ -185,7 +186,7 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
 			return IIO_VAL_INT_PLUS_MICRO;
 		case IIO_INCLI:
 			*val = 0;
-			*val2 = 25000; /* 0.025 degree */
+			*val2 = 25 * MILLI; /* 0.025 degree */
 			return IIO_VAL_INT_PLUS_MICRO;
 		default:
 			return -EINVAL;
Signature · 1 line
2.48.1
#2 lore raw

PATCH 2/2 iio: accel: adis16203: remove spi_set_drvdata()

In reply to Siddharth Menon

The driver does not use spi_get_drvdata() anywhere.

---
 drivers/staging/iio/accel/adis16203.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/iio/accel/adis16203.c +0 -2
index ac4b28bcd766..ec21365bb391 100644
@@ -268,8 +268,6 @@ static int adis16203_probe(struct spi_device *spi)
 	if (!indio_dev)
 		return -ENOMEM;
 	st = iio_priv(indio_dev);
-	/* this is only used for removal purposes */
-	spi_set_drvdata(spi, indio_dev);
 
 	indio_dev->name = spi->dev.driver->name;
 	indio_dev->channels = adis16203_channels;
Signature · 1 line
2.48.1
maintainer
#3 lore raw
In reply to Siddharth Menon
Quoted 10 lines · On Wed, 5 Mar 2025 20:59:10 +0530 Siddharth Menon <[email protected]> wrote:

This series improves the adis16203 driver by using standard unit macros and removing an unused spi_set_drvdata() call.

Siddharth Menon (2):
iio: accel: adis16203: Use units.h macros for voltage values
iio: accel: adis16203: Remove spi_set_drvdata()

 drivers/staging/iio/accel/adis16203.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

I'm not going to apply these because I think you correct identified that the device support should just be added to the adis16201 driver and this one dropped. Good thing you were more awake on this than me ;)

Jonathan

maintainer
#4 lore raw
Quoted 10 lines · On Sat, 8 Mar 2025 14:43:57 +0000 Jonathan Cameron <[email protected]> wrote:
Quoted 7 lines · On Wed, 5 Mar 2025 20:59:10 +0530 Siddharth Menon <[email protected]> wrote:

This series improves the adis16203 driver by using standard unit macros and removing an unused spi_set_drvdata() call.

Siddharth Menon (2):
iio: accel: adis16203: Use units.h macros for voltage values
iio: accel: adis16203: Remove spi_set_drvdata()

Quoted 9 lines
Quoted 3 lines
 drivers/staging/iio/accel/adis16203.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

I'm not going to apply these because I think you correct identified that the device support should just be added to the adis16201 driver and this one dropped. Good thing you were more awake on this than me ;)

Sorry - wrong person.
https://lore.kernel.org/all/[email protected]/

I'm definitely not awake today.

Jonathan

Quoted 1 line

Jonathan

#5 lore raw
Quoted 7 lines · Jonathan Cameron
Quoted 6 lines

I'm not going to apply these because I think you correct identified that the device support should just be added to the adis16201 driver and this one dropped. Good thing you were more awake on this than me ;)

Sorry - wrong person.

Well, I’ll assume these won't be getting applied.

Siddharth Menon

maintainer
#6 lore raw
Quoted 10 lines · On Sun, 9 Mar 2025 11:18:18 +0530 Siddharth Menon <[email protected]> wrote:
Quoted 7 lines · Jonathan Cameron
Quoted 6 lines

I'm not going to apply these because I think you correct identified that the device support should just be added to the adis16201 driver and this one dropped. Good thing you were more awake on this than me ;)

Sorry - wrong person.

Well, I’ll assume these won't be getting applied.

Yes, sorry you wasted your time on this!

Jonathan

Quoted 3 lines

Siddharth Menon