static void sx865x_penrelease_timer_handler(struct timer_list *t)
{
struct sx8654 *ts = timer_container_of(ts, t, timer);
- unsigned long flags;
- spin_lock_irqsave(&ts->lock, flags);
- sx865x_penrelease(ts);
- spin_unlock_irqrestore(&ts->lock, flags);
dev_dbg(&ts->client->dev, "penrelease by timer\n");
+
+ guard(spinlock_irqsave)(&ts->lock);
+ sx865x_penrelease(ts);
}
static irqreturn_t sx8650_irq(int irq, void *handle)
struct sx8654 *ts = handle;
struct device *dev = &ts->client->dev;
int len, i;
- unsigned long flags;
u8 stat;
u16 x, y;
u16 ch;
return IRQ_HANDLED;
}
- spin_lock_irqsave(&ts->lock, flags);
+ guard(spinlock_irqsave)(&ts->lock);
x = 0;
y = 0;
dev_dbg(dev, "point(%4d,%4d)\n", x, y);
mod_timer(&ts->timer, jiffies + SX8650_PENIRQ_TIMEOUT);
- spin_unlock_irqrestore(&ts->lock, flags);
return IRQ_HANDLED;
}