mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
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>
This commit is contained in:
parent
c03dfa7fdf
commit
0e45a09a1d
1 changed files with 3 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
#define _SERIO_H
|
||||
|
||||
|
||||
#include <linux/cleanup.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/list.h>
|
||||
|
@ -161,4 +162,6 @@ static inline void serio_continue_rx(struct serio *serio)
|
|||
spin_unlock_irq(&serio->lock);
|
||||
}
|
||||
|
||||
DEFINE_GUARD(serio_pause_rx, struct serio *, serio_pause_rx(_T), serio_continue_rx(_T))
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue