Commit 2a388f5e authored by Russell King's avatar Russell King

[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: default avatarRussell King <rmk@arm.linux.org.uk>
parent 62343f76
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment