Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+3 -4
+3 -4
drivers/input/touchscreen/mxs-lradc-ts.c
··· 500 500 LRADC_CTRL1_TOUCH_DETECT_IRQ | 501 501 LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL1) | 502 502 LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL2); 503 - unsigned long flags; 504 503 505 504 if (!(reg & mxs_lradc_irq_mask(lradc))) 506 505 return IRQ_NONE; 507 506 508 507 if (reg & ts_irq_mask) { 509 - spin_lock_irqsave(&ts->lock, flags); 510 - mxs_lradc_handle_touch(ts); 511 - spin_unlock_irqrestore(&ts->lock, flags); 508 + scoped_guard(spinlock_irqsave, &ts->lock) { 509 + mxs_lradc_handle_touch(ts); 510 + } 512 511 /* Make sure we don't clear the next conversion's interrupt. */ 513 512 clr_irq &= ~(LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL1) | 514 513 LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL2));