summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@flint.arm.linux.org.uk>2005-01-15 11:42:19 +0000
committerRussell King <rmk@flint.arm.linux.org.uk>2005-01-15 11:42:19 +0000
commit2a388f5e5c76f774cbeaeea683d637bc53ae4d21 (patch)
tree38d8574e8fb6812eeeae263c63c89a9445eb8e6b
parent62343f7629a612d82f0314777b17dff7807976dc (diff)
[SERIAL] Fix serial console resume
Don't use uart_change_speed() when trying to restore the serial console settings - the port may not have a tty associated with it. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--drivers/serial/serial_core.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 5ed45a7cbdda..16c227d30016 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1877,7 +1877,21 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
* Re-enable the console device after suspending.
*/
if (uart_console(port)) {
- uart_change_speed(state, NULL);
+ struct termios termios;
+
+ /*
+ * First try to use the console cflag setting.
+ */
+ memset(&termios, 0, sizeof(struct termios));
+ termios.c_cflag = port->cons->cflag;
+
+ /*
+ * If that's unset, use the tty termios setting.
+ */
+ if (state->info && state->info->tty && termios.c_cflag == 0)
+ termios = *state->info->tty->termios;
+
+ port->ops->set_termios(port, &termios, NULL);
console_start(port->cons);
}