Re: [PATCH v2] iio: imu: kmx61: Use guard(mutex)() family over manual locking

From: Maxwell Doose

Date: Tue May 05 2026 - 00:46:31 EST


Hi,

On Mon, May 4, 2026 at 7:55 PM Maxwell Doose <m32285159@xxxxxxxxx> wrote:
>
> Include linux/cleanup.h to take advantage of new macros.
>
> Replace manual mutex_lock() and mutex_unlock() calls across the file
> with guard(mutex)() and scoped_guard() where appropriate. This will help
> modernize the driver with up-to-date functions/macros.
>
> Remove now redundant gotos and ret variables, as the new RAII macros
> make them unneeded.
>
> Signed-off-by: Maxwell Doose <m32285159@xxxxxxxxx>
> ---
> v2:
> - Remove redundant blank line per Andy.
> - Put kmx61_set_mode() function call in kmx61_runtime_suspend() on one
> line per Andy.
>
> drivers/iio/imu/kmx61.c | 76 ++++++++++++++---------------------------
> 1 file changed, 25 insertions(+), 51 deletions(-)
[snip]

I just got the report in from the CI bot on the v1, and there are
still things in this patch that need to be fixed, consider this
superseded. I'm going to be writing a v3 in the morning (my time) to
resolve this.

best regards,
max