Re: [PATCH v2] iio: adc: xilinx-ams: Replace spin_lock() and unlock() calls with guard(spinlock*)()
From: Salih Erim
Date: Wed May 13 2026 - 21:34:20 EST
Hi Maxwell,
On 5/8/2026 1:45 PM, Maxwell Doose wrote:
Include linux/cleanup.h to take advantage of RAII macros.
Replace spin_lock() and unlock() calls with their RAII macro
counterparts, which modernizes the code and increases readability.
Remove "flags" variables where spin_lock_irqsave() has been replaced
with guard(spinlock_irqsave)().
Signed-off-by: Maxwell Doose <m32285159@xxxxxxxxx>
---
v2:
- Replace guard(spinlock_irq)() in ams_unmask_worker() with
scoped_guard() per Jonathan's suggestion.
Nice cleanup, thanks for taking care of this.
Reviewed-by: Salih Erim <salih.erim@xxxxxxx>
Salih.