mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-14 17:14:09 +00:00
iio: dac: ad5421: 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:
parent
2191d0fba7
commit
365736e77c
@ -514,16 +514,7 @@ static int ad5421_probe(struct spi_device *spi)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return iio_device_register(indio_dev);
|
return devm_iio_device_register(&spi->dev, indio_dev);
|
||||||
}
|
|
||||||
|
|
||||||
static int ad5421_remove(struct spi_device *spi)
|
|
||||||
{
|
|
||||||
struct iio_dev *indio_dev = spi_get_drvdata(spi);
|
|
||||||
|
|
||||||
iio_device_unregister(indio_dev);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct spi_driver ad5421_driver = {
|
static struct spi_driver ad5421_driver = {
|
||||||
@ -532,7 +523,6 @@ static struct spi_driver ad5421_driver = {
|
|||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
},
|
},
|
||||||
.probe = ad5421_probe,
|
.probe = ad5421_probe,
|
||||||
.remove = ad5421_remove,
|
|
||||||
};
|
};
|
||||||
module_spi_driver(ad5421_driver);
|
module_spi_driver(ad5421_driver);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user