Re: [PATCH v3 3/9] iio: amplifiers: ad8366: use devm_mutex_init() and drop mutex_init()

From: Jonathan Cameron

Date: Thu Feb 05 2026 - 15:33:09 EST


On Wed, 4 Feb 2026 03:53:36 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:

> On Tue, Feb 03, 2026 at 11:24:09AM +0000, Rodrigo Alencar via B4 Relay wrote:
>
> > Adopt proper mutex lifecycle with devm_mutex_init(),
> > replacing mutex_init().
>
> ...
>
> It's better to add here
>
> struct device *dev = &spi->dev;
>
> and (re-)use it in all followup patches. This will make the code easier
> to read.

Just to be clear. Please add a patch before this making use of
what Andy suggests in existing code. Then it will be available
to use in this patch as well.

Thanks,

Jonathan

>
> > + ret = devm_mutex_init(&spi->dev, &st->lock);
> > + if (ret)
> > + return ret;
>