Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

David Lechner and committed by
Jonathan Cameron
7af0ad4d 89fd809a

+1 -10
+1 -10
drivers/iio/dac/ad5761.c
··· 302 302 st = iio_priv(iio_dev); 303 303 304 304 st->spi = spi; 305 - spi_set_drvdata(spi, iio_dev); 306 305 307 306 ret = devm_regulator_get_enable_read_voltage(&spi->dev, "vref"); 308 307 if (ret < 0 && ret != -ENODEV) ··· 340 341 iio_dev->num_channels = 1; 341 342 iio_dev->name = spi_get_device_id(st->spi)->name; 342 343 343 - return iio_device_register(iio_dev); 344 - } 345 - 346 - static void ad5761_remove(struct spi_device *spi) 347 - { 348 - struct iio_dev *iio_dev = spi_get_drvdata(spi); 349 - 350 - iio_device_unregister(iio_dev); 344 + return devm_iio_device_register(&spi->dev, iio_dev); 351 345 } 352 346 353 347 static const struct spi_device_id ad5761_id[] = { ··· 357 365 .name = "ad5761", 358 366 }, 359 367 .probe = ad5761_probe, 360 - .remove = ad5761_remove, 361 368 .id_table = ad5761_id, 362 369 }; 363 370 module_spi_driver(ad5761_driver);