Re: [PATCH] acpi: pmic: Replace mutex_lock/unlock() with guard()/scoped_guard()

From: Maxwell Doose

Date: Fri Apr 24 2026 - 09:17:07 EST


On Fri, Apr 24, 2026 at 4:13 AM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxx> wrote:
>
> No. You need to either split a helper and use guard()() there, or indent the
> body of scoped_guard() accordingly.

Ah, I missed that. Thanks for pointing that out.

> This is not a switch-case and direct returns in if-else-if makes it harder to
> follow. What you need is to drop now redundant 'else':s and leave the last one
> unconditionally as the last code in the function.

Sounds good, I'll start adding those changes for a v2 for this at some point.

best regards,
maxwell