summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2013-10-29 15:39:00 +0400
committerJonathan Cameron <jic23@kernel.org>2013-11-25 01:07:17 +0400
commit79788b7c448e3afb94e440a84eb60e425551de42 (patch)
tree5a2910d24b09e0f2443abf0c366e24bb4c4ded22 /drivers
parent1baeec9c37e52e0f3744137981d47a1353353ae5 (diff)
downloadlinux-79788b7c448e3afb94e440a84eb60e425551de42.tar.xz
iio: gyro: adis16130: Use devm_iio_device_register
devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/gyro/adis16130.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/iio/gyro/adis16130.c b/drivers/iio/gyro/adis16130.c
index 445c2aecfadd..8d08c7ed1ea6 100644
--- a/drivers/iio/gyro/adis16130.c
+++ b/drivers/iio/gyro/adis16130.c
@@ -161,13 +161,7 @@ static int adis16130_probe(struct spi_device *spi)
indio_dev->info = &adis16130_info;
indio_dev->modes = INDIO_DIRECT_MODE;
- return iio_device_register(indio_dev);
-}
-
-static int adis16130_remove(struct spi_device *spi)
-{
- iio_device_unregister(spi_get_drvdata(spi));
- return 0;
+ return devm_iio_device_register(&spi->dev, indio_dev);
}
static struct spi_driver adis16130_driver = {
@@ -176,7 +170,6 @@ static struct spi_driver adis16130_driver = {
.owner = THIS_MODULE,
},
.probe = adis16130_probe,
- .remove = adis16130_remove,
};
module_spi_driver(adis16130_driver);