Input: serio - define serio_pause_rx guard to pause and resume serio ports
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 5 Sep 2024 04:17:06 +0000 (21:17 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 4 Oct 2024 07:58:14 +0000 (00:58 -0700)
commit0e45a09a1da0872786885c505467aab8fb29b5b4
tree97c6f63d7599afbea6bef22787e2b258a34f8ec7
parentc03dfa7fdf7987d957acfc332d84720da6ed947a
Input: serio - define serio_pause_rx guard to pause and resume serio ports

serio_pause_rx() and serio_continue_rx() are usually used together to
temporarily stop receiving interrupts/data for a given serio port.
Define "serio_pause_rx" guard for this so that the port is always
resumed once critical section is over.

Example:

scoped_guard(serio_pause_rx, elo->serio) {
elo->expected_packet = toupper(packet[0]);
init_completion(&elo->cmd_done);
}

Link: https://lore.kernel.org/r/20240905041732.2034348-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
include/linux/serio.h