iio: adc: remove unused private data assigned with spi_set_drvdata()
Subsystems (6)
PATCH 1/1 iio: adc: remove unused private data assigned with spi_set_drvdata()
These were usually used before the conversion to devm_ functions, so that the remove hook would be able to retrieve the pointer and do cleanups on remove.
When the conversion happened, they should have been removed, but were omitted.
Some drivers were copied from drivers that fit the criteria described above. In any case, in order to prevent more drivers from being used as example (and have spi_set_drvdata() needlessly set), this change removes it from the IIO ADC group.
--- drivers/iio/adc/ad7476.c | 2 -- drivers/iio/adc/ad7766.c | 2 -- drivers/iio/adc/ad7768-1.c | 1 - drivers/iio/adc/ad7887.c | 1 - drivers/iio/adc/ad9467.c | 2 -- drivers/iio/adc/hi8435.c | 1 - drivers/iio/adc/max1027.c | 2 -- drivers/iio/adc/max1241.c | 2 -- drivers/iio/adc/ti-adc084s021.c | 3 --- drivers/iio/adc/ti-ads124s08.c | 2 -- drivers/iio/adc/ti-tsc2046.c | 2 -- 11 files changed, 20 deletions(-)
drivers/iio/adc/ad7476.c +0 -2
@@ -389,8 +389,6 @@ static int ad7476_probe(struct spi_device *spi)if (IS_ERR (st->convst_gpio))return PTR_ERR (st->convst_gpio); -spi_set_drvdata (spi, indio_dev); - st->spi = spi; indio_dev->name =spi_get_device_id (spi)->name;
drivers/iio/adc/ad7766.c +0 -2
@@ -273,8 +273,6 @@ static int ad7766_probe(struct spi_device *spi)return ret; } -spi_set_drvdata (spi, indio_dev); - ad7766->spi = spi;/* First byte always 0 */
drivers/iio/adc/ad7768-1.c +0 -1
@@ -610,7 +610,6 @@ static int ad7768_probe(struct spi_device *spi) st->mclk_freq =clk_get_rate (st->mclk); -spi_set_drvdata (spi, indio_dev);mutex_init (&st->lock); indio_dev->channels = ad7768_channels;
drivers/iio/adc/ad7887.c +0 -1
@@ -268,7 +268,6 @@ static int ad7887_probe(struct spi_device *spi) st->chip_info = &ad7887_chip_info_tbl[spi_get_device_id (spi)->driver_data]; -spi_set_drvdata (spi, indio_dev); st->spi = spi; indio_dev->name =spi_get_device_id (spi)->name;
drivers/iio/adc/ad9467.c +0 -2
@@ -434,8 +434,6 @@ static int ad9467_probe(struct spi_device *spi)mdelay (10 ); } -spi_set_drvdata (spi, st); - conv->chip_info = &info->axi_adc_info; id =ad9467_spi_read (spi,AN877_ADC_REG_CHIP_ID );
drivers/iio/adc/hi8435.c +0 -1
@@ -483,7 +483,6 @@ static int hi8435_probe(struct spi_device *spi)gpiod_set_value_cansleep (reset_gpio,1 ); } -spi_set_drvdata (spi, idev);mutex_init (&priv->lock); idev->name =spi_get_device_id (spi)->name;
drivers/iio/adc/max1027.c +0 -2
@@ -430,8 +430,6 @@ static int max1027_probe(struct spi_device *spi)return -ENOMEM ; } -spi_set_drvdata (spi, indio_dev); - st =iio_priv (indio_dev); st->spi = spi; st->info = &max1027_chip_info_tbl[spi_get_device_id (spi)->driver_data];
drivers/iio/adc/max1241.c +0 -2
@@ -147,8 +147,6 @@ static int max1241_probe(struct spi_device *spi) adc->spi = spi;mutex_init (&adc->lock); -spi_set_drvdata (spi, indio_dev); - adc->vdd =devm_regulator_get (dev,"vdd" );if (IS_ERR (adc->vdd)) {dev_err (dev,"failed to get vdd regulator\n" );
drivers/iio/adc/ti-adc084s021.c +0 -3
@@ -210,9 +210,6 @@ static int adc084s021_probe(struct spi_device *spi) adc =iio_priv (indio_dev); adc->spi = spi; -/* Connect the SPI device and the iio dev */ -spi_set_drvdata (spi, indio_dev); -/* Initiate the Industrial I/O device */ indio_dev->name =spi_get_device_id (spi)->name; indio_dev->modes =INDIO_DIRECT_MODE ;
drivers/iio/adc/ti-ads124s08.c +0 -2
@@ -327,8 +327,6 @@ static int ads124s_probe(struct spi_device *spi) ads124s_priv->chip_info = &ads124s_chip_info_tbl[spi_id->driver_data]; -spi_set_drvdata (spi, indio_dev); - ads124s_priv->spi = spi; indio_dev->name = spi_id->name;
drivers/iio/adc/ti-tsc2046.c +0 -2
@@ -639,8 +639,6 @@ static int tsc2046_adc_probe(struct spi_device *spi) priv =iio_priv (indio_dev); priv->dcfg = dcfg; -spi_set_drvdata (spi, indio_dev); - priv->spi = spi; indio_dev->name =TI_TSC2046_NAME ;
Signature · 1 line
2.31.1
Quoted 5 lines
Some drivers were copied from drivers that fit the criteria described above. In any case, in order to prevent more drivers from being used as example (and have
spi_set_drvdata()needlessly set), this change removes it from the IIO ADC group.
Oh yeah, I'm pretty sure that's how I ended up adding it in the max1241 code, too. Code monkey presents humble apologies :-).
All the best,
Alex
Quoted 9 lines · Alexandru Lazar
Quoted 6 lines
Some drivers were copied from drivers that fit the criteria described above. In any case, in order to prevent more drivers from being used as example (and have
spi_set_drvdata()needlessly set), this change removes it from the IIO ADC group.Oh yeah, I'm pretty sure that's how I ended up adding it in the max1241 code, too. Code monkey presents humble apologies :-).
Well, I also added one in the AD9467 driver in the same manner. So ¯\_(ツ)_/¯
Quoted 3 lines
All the best,
Alex
Jonathan Cameron
maintainerQuoted 8 lines · On Thu, 13 May 2021 15:14:57 +0300 Alexandru Ardelean <[email protected]>…
Quoted 7 lines · Alexandru Lazar
Quoted 6 lines
Some drivers were copied from drivers that fit the criteria described above. In any case, in order to prevent more drivers from being used as example (and have
spi_set_drvdata()needlessly set), this change removes it from the IIO ADC group.
Quoted 6 lines
Quoted 2 lines
Oh yeah, I'm pretty sure that's how I ended up adding it in the max1241 code, too. Code monkey presents humble apologies :-).
Well, I also added one in the AD9467 driver in the same manner. So ¯\_(ツ)_/¯
All look correct to me. I'll let this sit on the list for a few days before picking it up.
Thanks,
Jonathan
Quoted 3 lines
Quoted 3 lines
All the best,
Alex
Jonathan Cameron
maintainerQuoted 11 lines · On Thu, 13 May 2021 15:55:52 +0100 Jonathan Cameron <[email protected]> wrote:
Quoted 8 lines · On Thu, 13 May 2021 15:14:57 +0300 Alexandru Ardelean <[email protected]>…
Quoted 7 lines · Alexandru Lazar
Quoted 6 lines
Some drivers were copied from drivers that fit the criteria described above. In any case, in order to prevent more drivers from being used as example (and have
spi_set_drvdata()needlessly set), this change removes it from the IIO ADC group.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Oh yeah, I'm pretty sure that's how I ended up adding it in the max1241 code, too. Code monkey presents humble apologies :-).
Well, I also added one in the AD9467 driver in the same manner. So ¯\_(ツ)_/¯
All look correct to me. I'll let this sit on the list for a few days before picking it up.
Applied thanks.
Quoted 9 lines
Thanks,
Jonathan
Quoted 3 lines
Quoted 3 lines
All the best,
Alex