* [PATCH] staging:iio:ad9852: Use devm_iio_device_register
@ 2014-08-03 9:58 Himangi Saraogi
2014-08-07 13:47 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Himangi Saraogi @ 2014-08-03 9:58 UTC (permalink / raw)
To: Jonathan Cameron, Greg Kroah-Hartman, linux-iio, devel,
linux-kernel
Cc: Julia Lawall
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 <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
drivers/staging/iio/frequency/ad9852.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/staging/iio/frequency/ad9852.c b/drivers/staging/iio/frequency/ad9852.c
index 11e4367..af2f2cc 100644
--- a/drivers/staging/iio/frequency/ad9852.c
+++ b/drivers/staging/iio/frequency/ad9852.c
@@ -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);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging:iio:ad9852: Use devm_iio_device_register
2014-08-03 9:58 [PATCH] staging:iio:ad9852: Use devm_iio_device_register Himangi Saraogi
@ 2014-08-07 13:47 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2014-08-07 13:47 UTC (permalink / raw)
To: Himangi Saraogi, Greg Kroah-Hartman, linux-iio, devel,
linux-kernel
Cc: Julia Lawall
On 03/08/14 10:58, Himangi Saraogi wrote:
> 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 <himangi774@gmail.com>
> Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Applied to the togreg branch of iio.git
Thanks,
J
> ---
> drivers/staging/iio/frequency/ad9852.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/drivers/staging/iio/frequency/ad9852.c b/drivers/staging/iio/frequency/ad9852.c
> index 11e4367..af2f2cc 100644
> --- a/drivers/staging/iio/frequency/ad9852.c
> +++ b/drivers/staging/iio/frequency/ad9852.c
> @@ -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);
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-07 13:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-03 9:58 [PATCH] staging:iio:ad9852: Use devm_iio_device_register Himangi Saraogi
2014-08-07 13:47 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).