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: sx8654 - use guard notation when acquiring spinlock

Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+4 -7
+4 -7
drivers/input/touchscreen/sx8654.c
··· 117 117 static void sx865x_penrelease_timer_handler(struct timer_list *t) 118 118 { 119 119 struct sx8654 *ts = timer_container_of(ts, t, timer); 120 - unsigned long flags; 121 120 122 - spin_lock_irqsave(&ts->lock, flags); 123 - sx865x_penrelease(ts); 124 - spin_unlock_irqrestore(&ts->lock, flags); 125 121 dev_dbg(&ts->client->dev, "penrelease by timer\n"); 122 + 123 + guard(spinlock_irqsave)(&ts->lock); 124 + sx865x_penrelease(ts); 126 125 } 127 126 128 127 static irqreturn_t sx8650_irq(int irq, void *handle) ··· 129 130 struct sx8654 *ts = handle; 130 131 struct device *dev = &ts->client->dev; 131 132 int len, i; 132 - unsigned long flags; 133 133 u8 stat; 134 134 u16 x, y; 135 135 u16 ch; ··· 151 153 return IRQ_HANDLED; 152 154 } 153 155 154 - spin_lock_irqsave(&ts->lock, flags); 156 + guard(spinlock_irqsave)(&ts->lock); 155 157 156 158 x = 0; 157 159 y = 0; ··· 182 184 dev_dbg(dev, "point(%4d,%4d)\n", x, y); 183 185 184 186 mod_timer(&ts->timer, jiffies + SX8650_PENIRQ_TIMEOUT); 185 - spin_unlock_irqrestore(&ts->lock, flags); 186 187 187 188 return IRQ_HANDLED; 188 189 }