mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
tty: Replace ASYNC_CHECK_CD and update atomically
Replace ASYNC_CHECK_CD bit in the tty_port::flags field with TTY_PORT_CHECK_CD bit in the tty_port::iflags field. Introduce helpers tty_port_set_check_carrier() and tty_port_check_carrier() to abstract the atomic bit ops. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
807c8d81f4
commit
2d68655d15
13 changed files with 39 additions and 64 deletions
|
@ -584,6 +584,19 @@ static inline void tty_port_set_active(struct tty_port *port, bool val)
|
|||
clear_bit(TTY_PORT_ACTIVE, &port->iflags);
|
||||
}
|
||||
|
||||
static inline bool tty_port_check_carrier(struct tty_port *port)
|
||||
{
|
||||
return test_bit(TTY_PORT_CHECK_CD, &port->iflags);
|
||||
}
|
||||
|
||||
static inline void tty_port_set_check_carrier(struct tty_port *port, bool val)
|
||||
{
|
||||
if (val)
|
||||
set_bit(TTY_PORT_CHECK_CD, &port->iflags);
|
||||
else
|
||||
clear_bit(TTY_PORT_CHECK_CD, &port->iflags);
|
||||
}
|
||||
|
||||
extern struct tty_struct *tty_port_tty_get(struct tty_port *port);
|
||||
extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty);
|
||||
extern int tty_port_carrier_raised(struct tty_port *port);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue