On 10/16/22 19:34, Jonathan Cameron wrote:
From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> This driver only turns the power on at probe and off via a custom devm_add_action_or_reset() callback.
I think this one did not use devm_add_action_or_reset()
The new devm_regulator_get_enable() replaces this boilerplate code. Some additional refactoring to drop now unnecessary unwinding after this change. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> Cc: Tomasz Duszynski <tduszyns@xxxxxxxxx> --- drivers/iio/pressure/ms5611.h | 3 --- drivers/iio/pressure/ms5611_core.c | 32 +++++------------------------- 2 files changed, 5 insertions(+), 30 deletions(-)
// snip
@@ -477,7 +456,6 @@ void ms5611_remove(struct iio_dev *indio_dev) { iio_device_unregister(indio_dev); iio_triggered_buffer_cleanup(indio_dev); - ms5611_fini(indio_dev); } EXPORT_SYMBOL_NS(ms5611_remove, IIO_MS5611);
Just a thought but maybe the whole remove() could be done using devm()? (As far as I can say the current flow works. AFAICS the devm unwinding is done after the remove() has been ran. But perhaps it would be cleaner if the remove() would not need to be exported at all.)
With, or without the remove() removed, if commit description is fixed: Reviewed-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx> -- Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~