Re: [PATCH v10 6/8] gpio: pl061: use cleanup helpers for locks

From: Andy Shevchenko

Date: Thu Oct 15 2026 - 16:01:40 EST


On Thu, Oct 15, 2026 at 06:53:33PM +0800, Long Zhao via B4 Relay wrote:

> Convert raw_spinlock critical sections to guard() from cleanup.h.

guard()()

...

> @@ -270,9 +265,9 @@ static void pl061_irq_mask(struct irq_data *d)
> struct pl061 *pl061 = gpiochip_get_data(gc);
> u8 mask = BIT(irqd_to_hwirq(d) % PL061_GPIO_NR);
>
> - raw_spin_lock(&pl061->lock);
> + guard(raw_spinlock)(&pl061->lock);

Should be scoped_guard() in this case.

> regmap_clear_bits(pl061->regmap, GPIOIE, mask);
> - raw_spin_unlock(&pl061->lock);
>
> gpiochip_disable_irq(gc, d->hwirq);
> }
> @@ -285,9 +280,9 @@ static void pl061_irq_unmask(struct irq_data *d)
>
> gpiochip_enable_irq(gc, d->hwirq);
>
> - raw_spin_lock(&pl061->lock);
> + guard(raw_spinlock)(&pl061->lock);
> +
> regmap_set_bits(pl061->regmap, GPIOIE, mask);
> - raw_spin_unlock(&pl061->lock);
> }

Otherwise will be asymmetric with the unmask().

--
With Best Regards,
Andy Shevchenko