mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
Input: atkbd - use guard notation when pausing serio port
Using guard notation makes the code more compact and error handling more robust by ensuring that serio ports are resumed in all code paths when control leaves critical section. Link: https://lore.kernel.org/r/20240905041732.2034348-7-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
5866065f56
commit
30cb2f6350
@ -713,9 +713,9 @@ static int atkbd_event(struct input_dev *dev,
|
||||
|
||||
static inline void atkbd_enable(struct atkbd *atkbd)
|
||||
{
|
||||
serio_pause_rx(atkbd->ps2dev.serio);
|
||||
guard(serio_pause_rx)(atkbd->ps2dev.serio);
|
||||
|
||||
atkbd->enabled = true;
|
||||
serio_continue_rx(atkbd->ps2dev.serio);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -725,9 +725,9 @@ static inline void atkbd_enable(struct atkbd *atkbd)
|
||||
|
||||
static inline void atkbd_disable(struct atkbd *atkbd)
|
||||
{
|
||||
serio_pause_rx(atkbd->ps2dev.serio);
|
||||
guard(serio_pause_rx)(atkbd->ps2dev.serio);
|
||||
|
||||
atkbd->enabled = false;
|
||||
serio_continue_rx(atkbd->ps2dev.serio);
|
||||
}
|
||||
|
||||
static int atkbd_activate(struct atkbd *atkbd)
|
||||
|
Loading…
Reference in New Issue
Block a user