aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/imx.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index 285b414f3054..5d7b58f1fe42 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -924,11 +924,13 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
924 rational_best_approximation(16 * div * baud, sport->port.uartclk, 924 rational_best_approximation(16 * div * baud, sport->port.uartclk,
925 1 << 16, 1 << 16, &num, &denom); 925 1 << 16, 1 << 16, &num, &denom);
926 926
927 tdiv64 = sport->port.uartclk; 927 if (port->info && port->info->port.tty) {
928 tdiv64 *= num; 928 tdiv64 = sport->port.uartclk;
929 do_div(tdiv64, denom * 16 * div); 929 tdiv64 *= num;
930 tty_encode_baud_rate(sport->port.info->port.tty, 930 do_div(tdiv64, denom * 16 * div);
931 (speed_t)tdiv64, (speed_t)tdiv64); 931 tty_encode_baud_rate(sport->port.info->port.tty,
932 (speed_t)tdiv64, (speed_t)tdiv64);
933 }
932 934
933 num -= 1; 935 num -= 1;
934 denom -= 1; 936 denom -= 1;