aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/serial/serial_core.c5
1 files changed, 3 insertions, 2 deletions
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,
371 */ 371 */
372 termios->c_cflag &= ~CBAUD; 372 termios->c_cflag &= ~CBAUD;
373 if (old) { 373 if (old) {
374 termios->c_cflag |= old->c_cflag & CBAUD; 374 baud = tty_termios_baud_rate(old);
375 tty_termios_encode_baud_rate(termios, baud, baud);
375 old = NULL; 376 old = NULL;
376 continue; 377 continue;
377 } 378 }
@@ -380,7 +381,7 @@ uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
380 * As a last resort, if the quotient is zero, 381 * As a last resort, if the quotient is zero,
381 * default to 9600 bps 382 * default to 9600 bps
382 */ 383 */
383 termios->c_cflag |= B9600; 384 tty_termios_encode_baud_rate(termios, 9600, 9600);
384 } 385 }
385 386
386 return 0; 387 return 0;