Skip to content

Commit

Permalink
Merge master.kernel.org:/home/rmk/linux-2.6-serial
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Jul 3, 2005
2 parents 10e047b + 976ecd1 commit 08ab8c2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

/*
Expand Down

0 comments on commit 08ab8c2

Please sign in to comment.