staging: iio: adc: ad7816: Use spi_set_drvdata() for clarity
Subsystems (4)
PATCH 1/1 staging: iio: adc: ad7816: Use spi_set_drvdata() for clarity
Replace the use of dev_set_drvdata() with the spi_set_drvdata() helper. This is functionally identical, but improves readability.
Signed-off-by Salah Triki <[email protected]>
--- drivers/staging/iio/adc/ad7816.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/adc/ad7816.c +1 -1
@@ -360,7 +360,7 @@ static int ad7816_probe(struct spi_device *spi_dev)return -ENOMEM ; chip =iio_priv (indio_dev);/* this is only used for device removal purposes */ -dev_set_drvdata (&spi_dev->dev, indio_dev); +spi_set_drvdata (spi_dev, indio_dev); chip->spi_dev = spi_dev;for (i =0 ; i <=AD7816_CS_MAX ; i++)
Signature · 1 line
2.43.0
David Lechner
reviewerQuoted 13 lines · Salah Triki
Replace the use of
dev_set_drvdata()with thespi_set_drvdata()helper. This is functionally identical, but improves readability.Signed-off-by Salah Triki <[email protected]>--- drivers/staging/iio/adc/ad7816.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/iio/adc/ad7816.c +0
-0
drivers/staging/iio/adc/ad7816.c static int ad7816_probe(struct spi_device *spi_dev) · line 362
Quoted 3 lines
drivers/staging/iio/adc/ad7816.c +0
-0@@ -360,7 +360,7 @@ static int ad7816_probe(struct spi_device *spi_dev)return -ENOMEM ; chip =iio_priv (indio_dev);/* this is only used for device removal purposes */
This comment is no longer true. The driver does not have a .remove callback. So we can just remove the comment and the dev_set_drvdata().
Quoted 5 lines
drivers/staging/iio/adc/ad7816.c +1
-1-dev_set_drvdata (&spi_dev->dev, indio_dev); +spi_set_drvdata (spi_dev, indio_dev); chip->spi_dev = spi_dev;for (i =0 ; i <=AD7816_CS_MAX ; i++)