summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDavid Lechner <dlechner@baylibre.com>2024-10-23 18:54:14 -0500
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-11-01 14:54:46 +0000
commit7af0ad4dfa694b8b1829d6d0317649128058b378 (patch)
tree6f6a810e99786b88421e9de4ea230d0230988e91 /drivers
parent89fd809ae027cb9e8fb598953374235c9b8f90d7 (diff)
iio: dac: ad5761: drop driver remove callback
Drop use of the driver remove callback in the ad5761 driver. By making use of a a devm_ helper, we can avoid the need for the remove callback entirely. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241023-iio-regulator-refactor-round-5-v1-10-d0bd396b3f50@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/dac/ad5761.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/iio/dac/ad5761.c b/drivers/iio/dac/ad5761.c
index 55e33cf5806e..0aa5ba7f4654 100644
--- a/drivers/iio/dac/ad5761.c
+++ b/drivers/iio/dac/ad5761.c
@@ -302,7 +302,6 @@ static int ad5761_probe(struct spi_device *spi)
st = iio_priv(iio_dev);
st->spi = spi;
- spi_set_drvdata(spi, iio_dev);
ret = devm_regulator_get_enable_read_voltage(&spi->dev, "vref");
if (ret < 0 && ret != -ENODEV)
@@ -341,14 +340,7 @@ static int ad5761_probe(struct spi_device *spi)
iio_dev->num_channels = 1;
iio_dev->name = spi_get_device_id(st->spi)->name;
- return iio_device_register(iio_dev);
-}
-
-static void ad5761_remove(struct spi_device *spi)
-{
- struct iio_dev *iio_dev = spi_get_drvdata(spi);
-
- iio_device_unregister(iio_dev);
+ return devm_iio_device_register(&spi->dev, iio_dev);
}
static const struct spi_device_id ad5761_id[] = {
@@ -365,7 +357,6 @@ static struct spi_driver ad5761_driver = {
.name = "ad5761",
},
.probe = ad5761_probe,
- .remove = ad5761_remove,
.id_table = ad5761_id,
};
module_spi_driver(ad5761_driver);