mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-19 08:58:32 -05:00
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>
This commit is contained in:
committed by
Jonathan Cameron
parent
451bdc1dc9
commit
276821d1e0
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user