Skip to contentSkip to conversation

staging: iio: adis16203: Remove unneeded spi_set_drvdata()

PATCH In review Saalim Quadri 2 participants 3 messages Mar 5, 2025 – Mar 8, 2025

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

PATCH v2 1/1 staging: iio: adis16203: Remove unneeded spi_set_drvdata()

By making use of devm_iio_device_register(), we no longer have a driver remove callback.
Since this was the last user of spi_get_drvdata(),
we can drop the call to spi_set_drvdata().

---
 drivers/staging/iio/accel/adis16203.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/iio/accel/adis16203.c +0 -2
index c1c73308800c..3faf3c61046a 100644
@@ -267,8 +267,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.34.1
#1 lore raw

Sorry, I forgot to add a V2 description

V1 -> V2: Update commit message description

Sincerely,
Saalim Quadri

maintainer
#2 lore raw
In reply to Saalim Quadri
Quoted 6 lines · On Thu, 6 Mar 2025 05:19:49 +0530 Saalim Quadri <[email protected]> wrote:

By making use of devm_iio_device_register(), we no longer have a driver remove callback.
Since this was the last user of spi_get_drvdata(),
we can drop the call to spi_set_drvdata().

As per other discussion. Dropping this one as better to merge support into the adis16201 driver.

Quoted 17 lines
---
 drivers/staging/iio/accel/adis16203.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/iio/accel/adis16203.c +0 -2
index c1c73308800c..3faf3c61046a 100644
@@ -267,8 +267,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;