Input: mxs-lradc-ts - use guard notation when acquiring spinlock

Guard notation simplifies code and shows critical section more clearly.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Dmitry Torokhov
2026-03-25 07:53:57 -07:00
parent 03bf327434
commit 7c011b6ddb
+3 -4
View File
@@ -500,15 +500,14 @@ static irqreturn_t mxs_lradc_ts_handle_irq(int irq, void *data)
LRADC_CTRL1_TOUCH_DETECT_IRQ |
LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL1) |
LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL2);
unsigned long flags;
if (!(reg & mxs_lradc_irq_mask(lradc)))
return IRQ_NONE;
if (reg & ts_irq_mask) {
spin_lock_irqsave(&ts->lock, flags);
mxs_lradc_handle_touch(ts);
spin_unlock_irqrestore(&ts->lock, flags);
scoped_guard(spinlock_irqsave, &ts->lock) {
mxs_lradc_handle_touch(ts);
}
/* Make sure we don't clear the next conversion's interrupt. */
clr_irq &= ~(LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL1) |
LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL2));