Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d4d67be authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds
Browse files

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: default avatarAlan Cox <alan@redhat.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c8c6bfa3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;