Re: [PATCH 13/14] iio: pressure: ms5611: Use devm_regulator_get_enable()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 17 Oct 2022 09:26:15 +0300
Matti Vaittinen <mazziesaccount@xxxxxxxxx> wrote:

> 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 other changes hitting this driver are now upstream so applied
to the togreg branch of iio.git with a bit of fuzz.

Thanks,

Jonathan

> 
> > 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>
> 




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux