Skip to contentSkip to conversation

staging: iio: adis16203: Remove unneeded spi_set_drvdata()

PATCH Superseded Saalim Quadri 2 participants 3 messages Mar 3, 2025 – Mar 5, 2025

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

* Since we are making use of devm_iio_device_register(), we no longer need this nor do we have any spi_get_drvdata() in the driver.

---
 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
maintainer
#1 lore raw
Quoted 3 lines · On Mon, 3 Mar 2025 23:35:23 +0530 Saalim Quadri <[email protected]> wrote:

* Since we are making use of devm_iio_device_register(), we no longer need this nor do we have any spi_get_drvdata() in the driver.

Why have a single bullet point?
Also please rewrite in imperative sense. Something like

Driver no longer has a remove callback after conversion to fully devm_ managed probe(). Remove now unneeded spi_get_drvdata() as that value was previously on read in the remove() callback.

Quoted 1 line

Code is fine, so just this patch description stuff.

Thanks,

Jonathan

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;
#2 lore raw

Thank you for the review

I sent the patch v2 in a separate thread, if that is alright.

Sincerely,
Saalim Quadri