Re: [PATCH 1/2] devm-helpers: Add resource managed version of mutex init

Marek Behún
2024-02-23T12:26:53Z

On Thu, 22 Feb 2024 23:42:11 +0200
andy.shevchenko@gmail.com wrote:

> Thu, Feb 22, 2024 at 03:58:37PM +0100, Marek Behún kirjoitti:
> > A few drivers are doing resource-managed mutex initialization by
> > implementing ad-hoc one-liner mutex dropping functions and using them
> > with devm_add_action_or_reset(). Help drivers avoid these repeated
> > one-liners by adding managed version of mutex initialization.
> >
> > Use the new function devm_mutex_init() in the following drivers:
> > drivers/gpio/gpio-pisosr.c
> > drivers/gpio/gpio-sim.c
> > drivers/gpu/drm/xe/xe_hwmon.c
> > drivers/hwmon/nzxt-smart2.c
> > drivers/leds/leds-is31fl319x.c
> > drivers/power/supply/mt6370-charger.c
> > drivers/power/supply/rt9467-charger.c
>
> Pardon me, but why?
>
> https://lore.kernel.org/linux-leds/20231214173614.2820929-1-gnstark@salutedevices.com/
>
> Can you cooperate, folks, instead of doing something independently?

Thanks Andy for pointing to George's patch series.

I can drop the mutex_init() part and add just the debugfs part.

Marek