Skip to content

Commit

Permalink
staging: iio: ad9951: Use devm_iio_device_register
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
  • Loading branch information
himangi774 authored and jic23 committed Aug 7, 2014
1 parent 913b864 commit 84e93b3
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/staging/iio/frequency/ad9951.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down

0 comments on commit 84e93b3

Please sign in to comment.