Re: [PATCH v2] iio: magnetometer: bmc150_magn: Used guard() for mutex protection
From: David Lechner
Date: Tue Feb 03 2026 - 20:12:47 EST
On 2/3/26 7:05 PM, Neel Bullywon wrote:
> Replaced the manual mutex lock/unlock calls using guard() to simplify
> the error handling and reduce goto statement usage.
>
> By using RAII-style cleanup, it ensures the mutex is always released
> when exiting the function, regardless of the return path taken
>
> This was compiled test only
>
> Signed-off-by: Neel Bullywon <neelb2403@xxxxxxxxx>
> ---
Reviewed-by: David Lechner <dlechner@xxxxxxxxxxxx>