aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/imx.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-06-01 16:52:52 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 16:47:41 -0400
commiteab4f5af6b07009d1fc48bac5f3215c0cbfb2fc3 (patch)
treee966fec1389f578bfcad82ba2e9ba831e93d815c /drivers/serial/imx.c
parent192251352f912bccfb942ea35801d2357f11f592 (diff)
tty: serial - fix tty back references in termios
One or two drivers go poking back into the tty from the termios setting routine in unsafe ways. We don't need to pass the tty down because the [ab]users are just using it to get at things they can get at anyway. This leaves low_latency setting to sort out along with set_ldisc use. Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/imx.c')
-rw-r--r--drivers/serial/imx.c10
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;