diff options
-rw-r--r-- | drivers/serial/serial_core.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 3fd0134d36bf..2514d00c0f6f 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -2068,11 +2068,29 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) | |||
2068 | struct tty_port *port = &state->port; | 2068 | struct tty_port *port = &state->port; |
2069 | struct device *tty_dev; | 2069 | struct device *tty_dev; |
2070 | struct uart_match match = {uport, drv}; | 2070 | struct uart_match match = {uport, drv}; |
2071 | struct ktermios termios; | ||
2071 | 2072 | ||
2072 | mutex_lock(&port->mutex); | 2073 | mutex_lock(&port->mutex); |
2073 | 2074 | ||
2074 | if (!console_suspend_enabled && uart_console(uport)) { | 2075 | if (!console_suspend_enabled && uart_console(uport)) { |
2075 | /* no need to resume serial console, it wasn't suspended */ | 2076 | /* no need to resume serial console, it wasn't suspended */ |
2077 | /* | ||
2078 | * First try to use the console cflag setting. | ||
2079 | */ | ||
2080 | memset(&termios, 0, sizeof(struct ktermios)); | ||
2081 | termios.c_cflag = uport->cons->cflag; | ||
2082 | /* | ||
2083 | * If that's unset, use the tty termios setting. | ||
2084 | */ | ||
2085 | if (termios.c_cflag == 0) | ||
2086 | termios = *state->port.tty->termios; | ||
2087 | else { | ||
2088 | termios.c_ispeed = termios.c_ospeed = | ||
2089 | tty_termios_input_baud_rate(&termios); | ||
2090 | termios.c_ispeed = termios.c_ospeed = | ||
2091 | tty_termios_baud_rate(&termios); | ||
2092 | } | ||
2093 | uport->ops->set_termios(uport, &termios, NULL); | ||
2076 | mutex_unlock(&port->mutex); | 2094 | mutex_unlock(&port->mutex); |
2077 | return 0; | 2095 | return 0; |
2078 | } | 2096 | } |
@@ -2089,20 +2107,6 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) | |||
2089 | * Re-enable the console device after suspending. | 2107 | * Re-enable the console device after suspending. |
2090 | */ | 2108 | */ |
2091 | if (uart_console(uport)) { | 2109 | if (uart_console(uport)) { |
2092 | struct ktermios termios; | ||
2093 | |||
2094 | /* | ||
2095 | * First try to use the console cflag setting. | ||
2096 | */ | ||
2097 | memset(&termios, 0, sizeof(struct ktermios)); | ||
2098 | termios.c_cflag = uport->cons->cflag; | ||
2099 | |||
2100 | /* | ||
2101 | * If that's unset, use the tty termios setting. | ||
2102 | */ | ||
2103 | if (port->tty && termios.c_cflag == 0) | ||
2104 | termios = *port->tty->termios; | ||
2105 | |||
2106 | uart_change_pm(state, 0); | 2110 | uart_change_pm(state, 0); |
2107 | uport->ops->set_termios(uport, &termios, NULL); | 2111 | uport->ops->set_termios(uport, &termios, NULL); |
2108 | console_start(uport->cons); | 2112 | console_start(uport->cons); |