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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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;
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);