Re: [PATCH v1 1/3] gpio: pca9570: Use devm_mutex_init() for mutex initialization

From: Bartosz Golaszewski

Date: Tue Jan 13 2026 - 06:01:56 EST


On Tue, Jan 13, 2026 at 11:09 AM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> Replace mutex_init() with the devm_mutex_init(), to ensure proper mutex
> cleanup during probe failure and driver removal.
>

Well, I can almost hear Johan Hovold yelling at you that this is not
about mutex cleanup but merely a useless debugging feature.

Though personally, I'm fine with it. Just reword the commit message
because there's no actual cleanup happening other than freeing the
memory allocated for the devres entry. :)

Bartosz