Skip to content

Commit

Permalink
serial: speed setup failure reporting
Browse files Browse the repository at this point in the history
Invalid speeds are forced to 9600. Update the code for this to encode new
style baud rates properly.

Signed-off-by: Alan Cox <[email protected]>
Cc: Russell King <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alan-Cox authored and Linus Torvalds committed Feb 5, 2008
1 parent c8c6bfa commit 6d4d67b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down

0 comments on commit 6d4d67b

Please sign in to comment.