mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user