staging:iio:ad9852: Use devm_iio_device_register
Subsystems (4)
PATCH 1/1 staging:iio:ad9852: Use devm_iio_device_register
This patch introduces the use of devm_iio_device_register and does away with the unregister in the remove function.
Signed-off-by Himangi Saraogi <[email protected]>
Acked-by Julia Lawall <[email protected]>
--- drivers/staging/iio/frequency/ad9852.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/staging/iio/frequency/ad9852.c +1 -9
@@ -218,7 +218,7 @@ static int ad9852_probe(struct spi_device *spi) idev->info = &ad9852_info; idev->modes =INDIO_DIRECT_MODE ; - ret =iio_device_register (idev); + ret =devm_iio_device_register (&spi->dev, idev);if (ret)return ret; spi->max_speed_hz =2000000 ;
@@ -230,20 +230,12 @@ static int ad9852_probe(struct spi_device *spi)return 0 ; } -static int ad9852_remove (struct spi_device *spi) -{ -iio_device_unregister (spi_get_drvdata (spi)); - -return 0 ; -} -static struct spi_driver ad9852_driver = { .driver = { .name =DRV_NAME , .owner =THIS_MODULE , }, .probe = ad9852_probe, - .remove = ad9852_remove, };module_spi_driver (ad9852_driver);
Signature · 1 line
1.9.1
Quoted 5 lines · Himangi Saraogi
This patch introduces the use of
devm_iio_device_registerand does away with the unregister in the remove function.Signed-off-by Himangi Saraogi <[email protected]>Acked-by Julia Lawall <[email protected]>
Applied to the togreg branch of iio.git
Thanks,
J
Quoted 39 lines
--- drivers/staging/iio/frequency/ad9852.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)drivers/staging/iio/frequency/ad9852.c +1
-9@@ -218,7 +218,7 @@ static int ad9852_probe(struct spi_device *spi) idev->info = &ad9852_info; idev->modes =INDIO_DIRECT_MODE ; - ret =iio_device_register (idev); + ret =devm_iio_device_register (&spi->dev, idev);if (ret)return ret; spi->max_speed_hz =2000000 ;@@ -230,20 +230,12 @@ static int ad9852_probe(struct spi_device *spi)return 0 ; } -static int ad9852_remove (struct spi_device *spi) -{ -iio_device_unregister (spi_get_drvdata (spi)); - -return 0 ; -} -static struct spi_driver ad9852_driver = { .driver = { .name =DRV_NAME , .owner =THIS_MODULE , }, .probe = ad9852_probe, - .remove = ad9852_remove, };module_spi_driver (ad9852_driver);