Re: [PATCH v2] iio: chemical: scd30: Replace manual locking with RAII locking
From: Joshua Crofts
Date: Tue May 19 2026 - 09:47:50 EST
On Tue, 19 May 2026 at 15:28, Maxwell Doose <m32285159@xxxxxxxxx> wrote:
>
> scd30_core.c currently uses manual mutex_lock() and mutex_unlock()
> calls. Replace them with the newer guard(mutex)() for cleaner RAII
> patterns and to improve maintainability.
>
> Add new helper function scd30_trigger_handler_helper_locked() containing
> the critical section for scd30_trigger_handler().
>
> In addition, small refactor to replace "?:" operator with regular
> if/else returns.
>
> Signed-off-by: Maxwell Doose <m32285159@xxxxxxxxx>
> ---
LGTM, Sashiko also seems to be alright with it.
On another note - this driver sure needs cleaning up.
Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
--
Kind regards
CJD