diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-03 14:37:09 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-03 14:37:09 -0700 |
commit | 08ab8c20316d6189a16b8101544a3e32b4c75e49 (patch) | |
tree | 3415b4af13e5e1011b2ea3e6dee1b8d84da2d344 /drivers | |
parent | 10e047b40aafefef1fdc8ea4ea7837b9557a9400 (diff) | |
parent | 976ecd12b8144d066a23fe97c6fbfc1ac8470af7 (diff) |
Merge master.kernel.org:/home/rmk/linux-2.6-serial
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/serial_core.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 139863a787f..54699c3a00a 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -1808,6 +1808,12 @@ uart_set_options(struct uart_port *port, struct console *co, struct termios termios; int i; + /* + * Ensure that the serial console lock is initialised + * early. + */ + spin_lock_init(&port->lock); + memset(&termios, 0, sizeof(struct termios)); termios.c_cflag = CREAD | HUPCL | CLOCAL; @@ -2196,10 +2202,16 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port) state->port = port; - spin_lock_init(&port->lock); port->cons = drv->cons; port->info = state->info; + /* + * If this port is a console, then the spinlock is already + * initialised. + */ + if (!uart_console(port)) + spin_lock_init(&port->lock); + uart_configure_port(drv, state, port); /* |