iio: gyro: adis16130: 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>
This commit is contained in:
Родитель
1baeec9c37
Коммит
79788b7c44
|
@ -161,13 +161,7 @@ static int adis16130_probe(struct spi_device *spi)
|
|||
indio_dev->info = &adis16130_info;
|
||||
indio_dev->modes = INDIO_DIRECT_MODE;
|
||||
|
||||
return iio_device_register(indio_dev);
|
||||
}
|
||||
|
||||
static int adis16130_remove(struct spi_device *spi)
|
||||
{
|
||||
iio_device_unregister(spi_get_drvdata(spi));
|
||||
return 0;
|
||||
return devm_iio_device_register(&spi->dev, indio_dev);
|
||||
}
|
||||
|
||||
static struct spi_driver adis16130_driver = {
|
||||
|
@ -176,7 +170,6 @@ static struct spi_driver adis16130_driver = {
|
|||
.owner = THIS_MODULE,
|
||||
},
|
||||
.probe = adis16130_probe,
|
||||
.remove = adis16130_remove,
|
||||
};
|
||||
module_spi_driver(adis16130_driver);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче