diff mbox series

[09/11] iio: dac ltc2632: drop driver remove function

Message ID 20241120-iio-regulator-cleanup-round-6-v1-9-d5a5360f7ec3@baylibre.com (mailing list archive)
State Accepted
Headers show
Series iio: use devm_regulator_get_enable_read_voltage round 6 | expand

Commit Message

David Lechner Nov. 20, 2024, 9:33 p.m. UTC
Remove driver remove callback for the ltc2632 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>
---
 drivers/iio/dac/ltc2632.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Jonathan Cameron Nov. 23, 2024, 3:54 p.m. UTC | #1
On Wed, 20 Nov 2024 15:33:32 -0600
David Lechner <dlechner@baylibre.com> wrote:

> Remove driver remove callback for the ltc2632 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>
Applied.
diff mbox series

Patch

diff --git a/drivers/iio/dac/ltc2632.c b/drivers/iio/dac/ltc2632.c
index 28f8347eb687..999348836d87 100644
--- a/drivers/iio/dac/ltc2632.c
+++ b/drivers/iio/dac/ltc2632.c
@@ -317,7 +317,6 @@  static int ltc2632_probe(struct spi_device *spi)
 
 	st = iio_priv(indio_dev);
 
-	spi_set_drvdata(spi, indio_dev);
 	st->spi_dev = spi;
 
 	chip_info = (struct ltc2632_chip_info *)
@@ -351,14 +350,7 @@  static int ltc2632_probe(struct spi_device *spi)
 	indio_dev->channels = chip_info->channels;
 	indio_dev->num_channels = chip_info->num_channels;
 
-	return iio_device_register(indio_dev);
-}
-
-static void ltc2632_remove(struct spi_device *spi)
-{
-	struct iio_dev *indio_dev = spi_get_drvdata(spi);
-
-	iio_device_unregister(indio_dev);
+	return devm_iio_device_register(&spi->dev, indio_dev);
 }
 
 static const struct spi_device_id ltc2632_id[] = {
@@ -450,7 +442,6 @@  static struct spi_driver ltc2632_driver = {
 		.of_match_table = ltc2632_of_match,
 	},
 	.probe		= ltc2632_probe,
-	.remove		= ltc2632_remove,
 	.id_table	= ltc2632_id,
 };
 module_spi_driver(ltc2632_driver);