diff options
Diffstat (limited to 'drivers/serial/imx.c')
-rw-r--r-- | drivers/serial/imx.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index eacb588a9345..66ecc7ab6dab 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -909,13 +909,11 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, | |||
909 | rational_best_approximation(16 * div * baud, sport->port.uartclk, | 909 | rational_best_approximation(16 * div * baud, sport->port.uartclk, |
910 | 1 << 16, 1 << 16, &num, &denom); | 910 | 1 << 16, 1 << 16, &num, &denom); |
911 | 911 | ||
912 | if (port->state && port->state->port.tty) { | 912 | tdiv64 = sport->port.uartclk; |
913 | tdiv64 = sport->port.uartclk; | 913 | tdiv64 *= num; |
914 | tdiv64 *= num; | 914 | do_div(tdiv64, denom * 16 * div); |
915 | do_div(tdiv64, denom * 16 * div); | 915 | tty_termios_encode_baud_rate(termios, |
916 | tty_encode_baud_rate(sport->port.state->port.tty, | ||
917 | (speed_t)tdiv64, (speed_t)tdiv64); | 916 | (speed_t)tdiv64, (speed_t)tdiv64); |
918 | } | ||
919 | 917 | ||
920 | num -= 1; | 918 | num -= 1; |
921 | denom -= 1; | 919 | denom -= 1; |