Re: [PATCH v4 05/11] iio: amplifiers: ad8366: use devm_mutex_init() and drop mutex_init()

Andy Shevchenko
2026-02-15T07:51:04Z

On Sat, Feb 14, 2026 at 06:36:16PM +0000, Jonathan Cameron wrote:
> On Tue, 10 Feb 2026 19:42:05 +0000
> Rodrigo Alencar via B4 Relay <devnull+rodrigo.alencar.analog.com@kernel.org> wrote:

> > Adopt proper mutex lifecycle with devm_mutex_init(), replacing
> > mutex_init(). Also, Include linux/mutex.h header.
>
> Why move the *mutex_init()? Even if it is just because it looks better there,
> not breaking up spi related stuff, then say that.

Yes, this needs to be recorded. But actually initialising mutex (and lock
in general) earlier is usually a good thing and in some cases might even
fix a hidden bug.

--
With Best Regards,
Andy Shevchenko