aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/console.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-04-09 20:53:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-30 12:26:55 -0400
commitd41861ca19c9e96f12a4f1ebbc8255d00909a232 (patch)
tree4b09c15500d404b0b375469dd673f0bc8fd05f5f /drivers/usb/serial/console.c
parent80f02d5424301bf4df195d09b1a664f394435851 (diff)
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 <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/console.c')
-rw-r--r--drivers/usb/serial/console.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index a66b01bb1fa1..8967715fe6fc 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -127,7 +127,7 @@ static int usb_console_setup(struct console *co, char *options)
127 info->port = port; 127 info->port = port;
128 128
129 ++port->port.count; 129 ++port->port.count;
130 if (!test_bit(ASYNCB_INITIALIZED, &port->port.flags)) { 130 if (!tty_port_initialized(&port->port)) {
131 if (serial->type->set_termios) { 131 if (serial->type->set_termios) {
132 /* 132 /*
133 * allocate a fake tty so the driver can initialize 133 * allocate a fake tty so the driver can initialize
@@ -168,7 +168,7 @@ static int usb_console_setup(struct console *co, char *options)
168 tty_port_tty_set(&port->port, NULL); 168 tty_port_tty_set(&port->port, NULL);
169 tty_kref_put(tty); 169 tty_kref_put(tty);
170 } 170 }
171 set_bit(ASYNCB_INITIALIZED, &port->port.flags); 171 tty_port_set_initialized(&port->port, 1);
172 } 172 }
173 /* Now that any required fake tty operations are completed restore 173 /* Now that any required fake tty operations are completed restore
174 * the tty port count */ 174 * the tty port count */