From 9c93cbac2a72e238229ecb070cbf7d4791c11cb8 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Thu, 26 May 2011 14:43:28 +0900 Subject: serial-core: keep value of console cflag in uart_update_termios uart_update_termios is called on console resume and restores the line parameters using cons->cflag before resetting it. However code in uart_resume_port does the same afterwards, applying a 0 value to the port's cflag and erasing the correct setting. This patch preserves the value of cflag in uart_update_termios to prevent this and allow the serial console to restore properly even if there is no program using it on user side. Serial code has been largely refactored upstream in the upstream kernel and faulty code apparently removed. Fixes bug 831077 Change-Id: Ia894f971d9b6bb0c6103dbca9d169dc2a2148f84 Reviewed-on: http://git-master/r/33098 Reviewed-by: Alex Courbot Tested-by: Alex Courbot Reviewed-by: David Schalig Reviewed-by: Janne Hellsten --- drivers/serial/serial_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 4c008f08a987..3132fd466291 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -1493,10 +1493,8 @@ static void uart_update_termios(struct tty_struct *tty, { struct uart_port *port = state->uart_port; - if (uart_console(port) && port->cons->cflag) { + if (uart_console(port) && port->cons->cflag) tty->termios->c_cflag = port->cons->cflag; - port->cons->cflag = 0; - } /* * If the device failed to grab its irq resources, -- cgit v1.2.3