Re: [PATCH v3 2/3] iio: adc: xilinx-ams: use guard(mutex) for automatic locking

From: Salih Erim

Date: Tue May 12 2026 - 11:10:19 EST


Hi,

On 4/14/2026 11:40 PM, Guilherme Ivo Bozi wrote:
Replace open-coded mutex_lock()/mutex_unlock() pairs with
guard(mutex) to simplify locking and ensure proper unlock on
all control flow paths.

This removes explicit unlock handling, reduces boilerplate,
and avoids potential mistakes in error paths while keeping
the behavior unchanged.

Signed-off-by: Guilherme Ivo Bozi <guilherme.bozi@xxxxxx>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
---
drivers/iio/adc/xilinx-ams.c | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)

Same indentation issue -- spaces instead of tabs on all new lines.

Salih