]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
iio: dac ltc2632: drop driver remove function
authorDavid Lechner <dlechner@baylibre.com>
Wed, 20 Nov 2024 21:33:32 +0000 (15:33 -0600)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 7 Dec 2024 17:47:57 +0000 (17:47 +0000)
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>
Link: https://patch.msgid.link/20241120-iio-regulator-cleanup-round-6-v1-9-d5a5360f7ec3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ltc2632.c

index 28f8347eb687e2bee3e960ab84cd8c58f30b0884..999348836d877dfaf21a2cccde4589c303f19af1 100644 (file)
@@ -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);