mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
tty: Replace ASYNC_INITIALIZED bit and update atomically
Replace ASYNC_INITIALIZED bit in the tty_port::flags field with TTY_PORT_INITIALIZED bit in the tty_port::iflags field. Introduce helpers tty_port_set_initialized() and tty_port_initialized() to abstract atomic bit ops. Note: the transforms for test_and_set_bit() and test_and_clear_bit() are unnecessary as the state transitions are already mutually exclusive; the tty lock prevents concurrent open/close/hangup. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
80f02d5424
commit
d41861ca19
27 changed files with 157 additions and 150 deletions
|
|
@ -629,8 +629,7 @@ static void ipoctal_hangup(struct tty_struct *tty)
|
|||
tty_port_hangup(&channel->tty_port);
|
||||
|
||||
ipoctal_reset_channel(channel);
|
||||
|
||||
clear_bit(ASYNCB_INITIALIZED, &channel->tty_port.flags);
|
||||
tty_port_set_initialized(&channel->tty_port, 0);
|
||||
wake_up_interruptible(&channel->tty_port.open_wait);
|
||||
}
|
||||
|
||||
|
|
@ -642,7 +641,7 @@ static void ipoctal_shutdown(struct tty_struct *tty)
|
|||
return;
|
||||
|
||||
ipoctal_reset_channel(channel);
|
||||
clear_bit(ASYNCB_INITIALIZED, &channel->tty_port.flags);
|
||||
tty_port_set_initialized(&channel->tty_port, 0);
|
||||
}
|
||||
|
||||
static void ipoctal_cleanup(struct tty_struct *tty)
|
||||
|
|
|
|||
Loading…
Reference in a new issue