Commit af097e86 authored by Himangi Saraogi's avatar Himangi Saraogi Committed by Jonathan Cameron

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: default avatarHimangi Saraogi <himangi774@gmail.com>
Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 84e93b38
...@@ -218,7 +218,7 @@ static int ad9852_probe(struct spi_device *spi) ...@@ -218,7 +218,7 @@ static int ad9852_probe(struct spi_device *spi)
idev->info = &ad9852_info; idev->info = &ad9852_info;
idev->modes = INDIO_DIRECT_MODE; idev->modes = INDIO_DIRECT_MODE;
ret = iio_device_register(idev); ret = devm_iio_device_register(&spi->dev, idev);
if (ret) if (ret)
return ret; return ret;
spi->max_speed_hz = 2000000; spi->max_speed_hz = 2000000;
...@@ -230,20 +230,12 @@ static int ad9852_probe(struct spi_device *spi) ...@@ -230,20 +230,12 @@ static int ad9852_probe(struct spi_device *spi)
return 0; 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 = { static struct spi_driver ad9852_driver = {
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.probe = ad9852_probe, .probe = ad9852_probe,
.remove = ad9852_remove,
}; };
module_spi_driver(ad9852_driver); module_spi_driver(ad9852_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment