From: Sachin Kamat Date: Tue, 29 Oct 2013 11:39:00 +0000 (+0000) Subject: staging: iio: adis16060: Use devm_iio_device_register X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f952a30c39ea6d1dd44a33af7532d3a043c0c6a3;p=linux-beck.git staging: iio: adis16060: Use devm_iio_device_register devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat Signed-off-by: Jonathan Cameron --- diff --git a/drivers/staging/iio/gyro/adis16060_core.c b/drivers/staging/iio/gyro/adis16060_core.c index 6d3d771154f3..d5d395c2e3e4 100644 --- a/drivers/staging/iio/gyro/adis16060_core.c +++ b/drivers/staging/iio/gyro/adis16060_core.c @@ -167,7 +167,7 @@ static int adis16060_r_probe(struct spi_device *spi) indio_dev->channels = adis16060_channels; indio_dev->num_channels = ARRAY_SIZE(adis16060_channels); - ret = iio_device_register(indio_dev); + ret = devm_iio_device_register(&spi->dev, indio_dev); if (ret) return ret; @@ -175,13 +175,6 @@ static int adis16060_r_probe(struct spi_device *spi) return 0; } -/* fixme, confirm ordering in this function */ -static int adis16060_r_remove(struct spi_device *spi) -{ - iio_device_unregister(spi_get_drvdata(spi)); - return 0; -} - static int adis16060_w_probe(struct spi_device *spi) { int ret; @@ -211,7 +204,6 @@ static struct spi_driver adis16060_r_driver = { .owner = THIS_MODULE, }, .probe = adis16060_r_probe, - .remove = adis16060_r_remove, }; static struct spi_driver adis16060_w_driver = {