summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lechner <dlechner@baylibre.com>2024-11-21 00:33:30 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-12-07 20:47:57 +0300
commit276821d1e04cd10db98cabcc532cbfef6bd3e529 (patch)
treee1f27adab985364f9af80169d53806a6bd96e8fe
parent451bdc1dc9cbadc0bb3567d0fa25e1898452e9fe (diff)
downloadlinux-276821d1e04cd10db98cabcc532cbfef6bd3e529.tar.xz
iio: dac ad8801: drop driver remove function
Remove driver remove callback in the ad8801 driver. By making use of devm_iio_device_register(), we no longer need a driver remove callback. Also since this was the last user of spi_get_drvdata(), we can drop the call to spi_set_drvdata(). Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241120-iio-regulator-cleanup-round-6-v1-7-d5a5360f7ec3@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/dac/ad8801.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/iio/dac/ad8801.c b/drivers/iio/dac/ad8801.c
index bd857754fc11..8a362fae2eca 100644
--- a/drivers/iio/dac/ad8801.c
+++ b/drivers/iio/dac/ad8801.c
@@ -136,14 +136,13 @@ static int ad8801_probe(struct spi_device *spi)
state->vrefl_mv = ret / 1000;
}
- spi_set_drvdata(spi, indio_dev);
indio_dev->info = &ad8801_info;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = ad8801_channels;
indio_dev->num_channels = ARRAY_SIZE(ad8801_channels);
indio_dev->name = id->name;
- ret = iio_device_register(indio_dev);
+ ret = devm_iio_device_register(&spi->dev, indio_dev);
if (ret)
return dev_err_probe(&spi->dev, ret,
"Failed to register iio device\n");
@@ -151,13 +150,6 @@ static int ad8801_probe(struct spi_device *spi)
return 0;
}
-static void ad8801_remove(struct spi_device *spi)
-{
- struct iio_dev *indio_dev = spi_get_drvdata(spi);
-
- iio_device_unregister(indio_dev);
-}
-
static const struct spi_device_id ad8801_ids[] = {
{"ad8801", ID_AD8801},
{"ad8803", ID_AD8803},
@@ -170,7 +162,6 @@ static struct spi_driver ad8801_driver = {
.name = "ad8801",
},
.probe = ad8801_probe,
- .remove = ad8801_remove,
.id_table = ad8801_ids,
};
module_spi_driver(ad8801_driver);