devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> --- drivers/staging/iio/frequency/ad9910.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/iio/frequency/ad9910.c b/drivers/staging/iio/frequency/ad9910.c index 755e048..8404945 100644 --- a/drivers/staging/iio/frequency/ad9910.c +++ b/drivers/staging/iio/frequency/ad9910.c @@ -337,7 +337,7 @@ static int ad9910_probe(struct spi_device *spi) idev->info = &ad9910_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; @@ -348,20 +348,12 @@ static int ad9910_probe(struct spi_device *spi) return 0; } -static int ad9910_remove(struct spi_device *spi) -{ - iio_device_unregister(spi_get_drvdata(spi)); - - return 0; -} - static struct spi_driver ad9910_driver = { .driver = { .name = DRV_NAME, .owner = THIS_MODULE, }, .probe = ad9910_probe, - .remove = ad9910_remove, }; module_spi_driver(ad9910_driver); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html