]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
staging: iio: ad9951: Use devm_iio_device_register
authorHimangi Saraogi <himangi774@gmail.com>
Sat, 8 Mar 2014 11:00:00 +0000 (11:00 +0000)
committerJonathan Cameron <jic23@kernel.org>
Thu, 7 Aug 2014 13:45:55 +0000 (14:45 +0100)
This patch introduces the use of devm_iio_device_register and does away
with the unregister in the remove function. The remove function is no
longer required and is completely removed.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/frequency/ad9951.c

index 5e8990a0210bf1d297d4eb8134c532fc17ff78fb..d465db0e9c0b24abeebf6c938dee440301486aed 100644 (file)
@@ -175,7 +175,7 @@ static int ad9951_probe(struct spi_device *spi)
        idev->info = &ad9951_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;
@@ -186,20 +186,12 @@ static int ad9951_probe(struct spi_device *spi)
        return 0;
 }
 
-static int ad9951_remove(struct spi_device *spi)
-{
-       iio_device_unregister(spi_get_drvdata(spi));
-
-       return 0;
-}
-
 static struct spi_driver ad9951_driver = {
        .driver = {
                .name = DRV_NAME,
                .owner = THIS_MODULE,
        },
        .probe = ad9951_probe,
-       .remove = ad9951_remove,
 };
 module_spi_driver(ad9951_driver);