All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: imu: remove unused private data assigned with spi_set_drvdata()
@ 2021-05-13 12:25 Alexandru Ardelean
  2021-06-09 20:10 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandru Ardelean @ 2021-05-13 12:25 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, nuno.sa, Alexandru Ardelean

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.

Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
---
 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(-)

diff --git a/drivers/iio/imu/adis16400.c b/drivers/iio/imu/adis16400.c
index cb8d3ffab6fc..109b2360a54e 100644
--- a/drivers/iio/imu/adis16400.c
+++ b/drivers/iio/imu/adis16400.c
@@ -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];
diff --git a/drivers/iio/imu/adis16460.c b/drivers/iio/imu/adis16460.c
index 73bf45e859b8..068d98780383 100644
--- a/drivers/iio/imu/adis16460.c
+++ b/drivers/iio/imu/adis16460.c
@@ -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;
diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c
index 5654c0c15426..90aec3c9dbcb 100644
--- a/drivers/iio/imu/adis16475.c
+++ b/drivers/iio/imu/adis16475.c
@@ -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)
diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
index f81b86690b76..c7dd1150780d 100644
--- a/drivers/iio/imu/adis16480.c
+++ b/drivers/iio/imu/adis16480.c
@@ -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];
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: imu: remove unused private data assigned with spi_set_drvdata()
  2021-05-13 12:25 [PATCH] iio: imu: remove unused private data assigned with spi_set_drvdata() Alexandru Ardelean
@ 2021-06-09 20:10 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2021-06-09 20:10 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel, nuno.sa

On Thu, 13 May 2021 15:25:12 +0300
Alexandru Ardelean <aardelean@deviqon.com> wrote:

> 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.
> 
> Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
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

> ---
>  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(-)
> 
> diff --git a/drivers/iio/imu/adis16400.c b/drivers/iio/imu/adis16400.c
> index cb8d3ffab6fc..109b2360a54e 100644
> --- a/drivers/iio/imu/adis16400.c
> +++ b/drivers/iio/imu/adis16400.c
> @@ -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];
> diff --git a/drivers/iio/imu/adis16460.c b/drivers/iio/imu/adis16460.c
> index 73bf45e859b8..068d98780383 100644
> --- a/drivers/iio/imu/adis16460.c
> +++ b/drivers/iio/imu/adis16460.c
> @@ -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;
> diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c
> index 5654c0c15426..90aec3c9dbcb 100644
> --- a/drivers/iio/imu/adis16475.c
> +++ b/drivers/iio/imu/adis16475.c
> @@ -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)
> diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
> index f81b86690b76..c7dd1150780d 100644
> --- a/drivers/iio/imu/adis16480.c
> +++ b/drivers/iio/imu/adis16480.c
> @@ -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];


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-09 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 12:25 [PATCH] iio: imu: remove unused private data assigned with spi_set_drvdata() Alexandru Ardelean
2021-06-09 20:10 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.