Re: [PATCH v2] iio: magnetometer: bmc150_magn: Used guard() for mutex protection

From: Andy Shevchenko

Date: Tue Feb 03 2026 - 20:20:18 EST


On Tue, Feb 03, 2026 at 08:05:29PM -0500, 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

Missed period.

> This was compiled test only

Ditto.

No need to put this into commit message.

Code wise looks good.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>

--
With Best Regards,
Andy Shevchenko