diff options
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/serial_core.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index d6e724034492..47657cf4f8b9 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c | |||
@@ -172,12 +172,16 @@ static int uart_startup(struct tty_struct *tty, struct uart_state *state, int in | |||
172 | 172 | ||
173 | retval = uport->ops->startup(uport); | 173 | retval = uport->ops->startup(uport); |
174 | if (retval == 0) { | 174 | if (retval == 0) { |
175 | if (init_hw) { | 175 | if (uart_console(uport) && uport->cons->cflag) { |
176 | /* | 176 | tty->termios->c_cflag = uport->cons->cflag; |
177 | * Initialise the hardware port settings. | 177 | uport->cons->cflag = 0; |
178 | */ | 178 | } |
179 | uart_change_speed(tty, state, NULL); | 179 | /* |
180 | * Initialise the hardware port settings. | ||
181 | */ | ||
182 | uart_change_speed(tty, state, NULL); | ||
180 | 183 | ||
184 | if (init_hw) { | ||
181 | /* | 185 | /* |
182 | * Setup the RTS and DTR signals once the | 186 | * Setup the RTS and DTR signals once the |
183 | * port is open and ready to respond. | 187 | * port is open and ready to respond. |
@@ -1481,11 +1485,6 @@ static void uart_update_termios(struct tty_struct *tty, | |||
1481 | { | 1485 | { |
1482 | struct uart_port *port = state->uart_port; | 1486 | struct uart_port *port = state->uart_port; |
1483 | 1487 | ||
1484 | if (uart_console(port) && port->cons->cflag) { | ||
1485 | tty->termios->c_cflag = port->cons->cflag; | ||
1486 | port->cons->cflag = 0; | ||
1487 | } | ||
1488 | |||
1489 | /* | 1488 | /* |
1490 | * If the device failed to grab its irq resources, | 1489 | * If the device failed to grab its irq resources, |
1491 | * or some other error occurred, don't try to talk | 1490 | * or some other error occurred, don't try to talk |
@@ -1493,11 +1492,6 @@ static void uart_update_termios(struct tty_struct *tty, | |||
1493 | */ | 1492 | */ |
1494 | if (!(tty->flags & (1 << TTY_IO_ERROR))) { | 1493 | if (!(tty->flags & (1 << TTY_IO_ERROR))) { |
1495 | /* | 1494 | /* |
1496 | * Make termios settings take effect. | ||
1497 | */ | ||
1498 | uart_change_speed(tty, state, NULL); | ||
1499 | |||
1500 | /* | ||
1501 | * And finally enable the RTS and DTR signals. | 1495 | * And finally enable the RTS and DTR signals. |
1502 | */ | 1496 | */ |
1503 | if (tty->termios->c_cflag & CBAUD) | 1497 | if (tty->termios->c_cflag & CBAUD) |