From: Alan Cox Date: Tue, 5 Feb 2008 06:27:53 +0000 (-0800) Subject: serial: speed setup failure reporting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d4d67beb963de8865499781b8523e5b683819c3;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git serial: speed setup failure reporting Invalid speeds are forced to 9600. Update the code for this to encode new style baud rates properly. Signed-off-by: Alan Cox Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 304fe32eb066..276da148c57e 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -371,7 +371,8 @@ uart_get_baud_rate(struct uart_port *port, struct ktermios *termios, */ termios->c_cflag &= ~CBAUD; if (old) { - termios->c_cflag |= old->c_cflag & CBAUD; + baud = tty_termios_baud_rate(old); + tty_termios_encode_baud_rate(termios, baud, baud); old = NULL; continue; } @@ -380,7 +381,7 @@ uart_get_baud_rate(struct uart_port *port, struct ktermios *termios, * As a last resort, if the quotient is zero, * default to 9600 bps */ - termios->c_cflag |= B9600; + tty_termios_encode_baud_rate(termios, 9600, 9600); } return 0;