diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-10-29 11:39:00 +0000 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-11-24 21:07:16 +0000 |
commit | 365736e77cb7facea72b212aaef66d88b8f38a8d (patch) | |
tree | 603fc4eb80e75eb3c4e5c24ad9d9f38c5f300397 /drivers/iio/dac/ad5421.c | |
parent | 2191d0fba75c77efef8e4fd50641fb19772b72eb (diff) | |
download | op-kernel-dev-365736e77cb7facea72b212aaef66d88b8f38a8d.zip op-kernel-dev-365736e77cb7facea72b212aaef66d88b8f38a8d.tar.gz |
iio: dac: ad5421: 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/dac/ad5421.c')
-rw-r--r-- | drivers/iio/dac/ad5421.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/iio/dac/ad5421.c b/drivers/iio/dac/ad5421.c index 3eeaa82..7d1e908 100644 --- a/drivers/iio/dac/ad5421.c +++ b/drivers/iio/dac/ad5421.c @@ -514,16 +514,7 @@ static int ad5421_probe(struct spi_device *spi) return ret; } - return iio_device_register(indio_dev); -} - -static int ad5421_remove(struct spi_device *spi) -{ - struct iio_dev *indio_dev = spi_get_drvdata(spi); - - iio_device_unregister(indio_dev); - - return 0; + return devm_iio_device_register(&spi->dev, indio_dev); } static struct spi_driver ad5421_driver = { @@ -532,7 +523,6 @@ static struct spi_driver ad5421_driver = { .owner = THIS_MODULE, }, .probe = ad5421_probe, - .remove = ad5421_remove, }; module_spi_driver(ad5421_driver); |