iio: imu: remove unused private data assigned with spi_set_drvdata()
Subsystems (4)
PATCH 1/1 iio: imu: 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 IMU group.
--- drivers/iio/imu/adis16400.c | 2 -- drivers/iio/imu/adis16460.c | 2 -- drivers/iio/imu/adis16475.c | 1 - drivers/iio/imu/adis16480.c | 2 -- 4 files changed, 7 deletions(-)
drivers/iio/imu/adis16400.c +0 -2
@@ -1164,8 +1164,6 @@ static int adis16400_probe(struct spi_device *spi)return -ENOMEM ; st =iio_priv (indio_dev); -/* this is only used for removal purposes */ -spi_set_drvdata (spi, indio_dev);/* setup the industrialio driver allocated elements */ st->variant = &adis16400_chips[spi_get_device_id (spi)->driver_data];
drivers/iio/imu/adis16460.c +0 -2
@@ -388,8 +388,6 @@ static int adis16460_probe(struct spi_device *spi)if (indio_dev ==NULL )return -ENOMEM ; -spi_set_drvdata (spi, indio_dev); - st =iio_priv (indio_dev); st->chip_info = &adis16460_chip_info;
drivers/iio/imu/adis16475.c +0 -1
@@ -1329,7 +1329,6 @@ static int adis16475_probe(struct spi_device *spi)return -ENOMEM ; st =iio_priv (indio_dev); -spi_set_drvdata (spi, indio_dev); st->info =device_get_match_data (&spi->dev);if (!st->info)
drivers/iio/imu/adis16480.c +0 -2
@@ -1279,8 +1279,6 @@ static int adis16480_probe(struct spi_device *spi)if (indio_dev ==NULL )return -ENOMEM ; -spi_set_drvdata (spi, indio_dev); - st =iio_priv (indio_dev); st->chip_info = &adis16480_chip_info[id->driver_data];
Signature · 1 line
2.31.1
Jonathan Cameron
maintainerQuoted 6 lines · On Thu, 13 May 2021 15:25:12 +0300 Alexandru Ardelean <[email protected]>…
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.
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 IMU group.Signed-off-by Alexandru Ardelean <[email protected]>
Hohum. I missed this one due to an error in my colour coding scheme that had it having dependencies. Oops.
Applied to the togreg branch of iio.git and pushed out as testing for 0-day to poke at.
Thanks,
Jonathan
Quoted 58 lines
--- drivers/iio/imu/adis16400.c | 2 -- drivers/iio/imu/adis16460.c | 2 -- drivers/iio/imu/adis16475.c | 1 - drivers/iio/imu/adis16480.c | 2 -- 4 files changed, 7 deletions(-)drivers/iio/imu/adis16400.c +0
-2@@ -1164,8 +1164,6 @@ static int adis16400_probe(struct spi_device *spi)return -ENOMEM ; st =iio_priv (indio_dev); -/* this is only used for removal purposes */ -spi_set_drvdata (spi, indio_dev);/* setup the industrialio driver allocated elements */ st->variant = &adis16400_chips[spi_get_device_id (spi)->driver_data];drivers/iio/imu/adis16460.c +0
-2@@ -388,8 +388,6 @@ static int adis16460_probe(struct spi_device *spi)if (indio_dev ==NULL )return -ENOMEM ; -spi_set_drvdata (spi, indio_dev); - st =iio_priv (indio_dev); st->chip_info = &adis16460_chip_info;drivers/iio/imu/adis16475.c +0
-1@@ -1329,7 +1329,6 @@ static int adis16475_probe(struct spi_device *spi)return -ENOMEM ; st =iio_priv (indio_dev); -spi_set_drvdata (spi, indio_dev); st->info =device_get_match_data (&spi->dev);if (!st->info)drivers/iio/imu/adis16480.c +0
-2@@ -1279,8 +1279,6 @@ static int adis16480_probe(struct spi_device *spi)if (indio_dev ==NULL )return -ENOMEM ; -spi_set_drvdata (spi, indio_dev); - st =iio_priv (indio_dev); st->chip_info = &adis16480_chip_info[id->driver_data];