diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-10-29 07:39:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-11-24 16:07:17 -0500 |
commit | 79788b7c448e3afb94e440a84eb60e425551de42 (patch) | |
tree | 5a2910d24b09e0f2443abf0c366e24bb4c4ded22 /drivers/iio/gyro/adis16130.c | |
parent | 1baeec9c37e52e0f3744137981d47a1353353ae5 (diff) |
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/iio/gyro/adis16130.c')
-rw-r--r-- | drivers/iio/gyro/adis16130.c | 9 |
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) | |||
161 | indio_dev->info = &adis16130_info; | 161 | indio_dev->info = &adis16130_info; |
162 | indio_dev->modes = INDIO_DIRECT_MODE; | 162 | indio_dev->modes = INDIO_DIRECT_MODE; |
163 | 163 | ||
164 | return iio_device_register(indio_dev); | 164 | return devm_iio_device_register(&spi->dev, indio_dev); |
165 | } | ||
166 | |||
167 | static int adis16130_remove(struct spi_device *spi) | ||
168 | { | ||
169 | iio_device_unregister(spi_get_drvdata(spi)); | ||
170 | return 0; | ||
171 | } | 165 | } |
172 | 166 | ||
173 | static struct spi_driver adis16130_driver = { | 167 | static struct spi_driver adis16130_driver = { |
@@ -176,7 +170,6 @@ static struct spi_driver adis16130_driver = { | |||
176 | .owner = THIS_MODULE, | 170 | .owner = THIS_MODULE, |
177 | }, | 171 | }, |
178 | .probe = adis16130_probe, | 172 | .probe = adis16130_probe, |
179 | .remove = adis16130_remove, | ||
180 | }; | 173 | }; |
181 | module_spi_driver(adis16130_driver); | 174 | module_spi_driver(adis16130_driver); |
182 | 175 | ||