diff options
author | Alan Cox <alan@linux.intel.com> | 2010-06-01 16:52:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 16:47:41 -0400 |
commit | eab4f5af6b07009d1fc48bac5f3215c0cbfb2fc3 (patch) | |
tree | e966fec1389f578bfcad82ba2e9ba831e93d815c /drivers/serial/21285.c | |
parent | 192251352f912bccfb942ea35801d2357f11f592 (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/21285.c')
-rw-r--r-- | drivers/serial/21285.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index 8681f1345056..d89aa38c5cf0 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c | |||
@@ -216,7 +216,7 @@ serial21285_set_termios(struct uart_port *port, struct ktermios *termios, | |||
216 | struct ktermios *old) | 216 | struct ktermios *old) |
217 | { | 217 | { |
218 | unsigned long flags; | 218 | unsigned long flags; |
219 | unsigned int baud, quot, h_lcr; | 219 | unsigned int baud, quot, h_lcr, b; |
220 | 220 | ||
221 | /* | 221 | /* |
222 | * We don't support modem control lines. | 222 | * We don't support modem control lines. |
@@ -234,12 +234,8 @@ serial21285_set_termios(struct uart_port *port, struct ktermios *termios, | |||
234 | */ | 234 | */ |
235 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); | 235 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); |
236 | quot = uart_get_divisor(port, baud); | 236 | quot = uart_get_divisor(port, baud); |
237 | 237 | b = port->uartclk / (16 * quot); | |
238 | if (port->state && port->state->port.tty) { | 238 | tty_termios_encode_baud_rate(termios, b, b); |
239 | struct tty_struct *tty = port->state->port.tty; | ||
240 | unsigned int b = port->uartclk / (16 * quot); | ||
241 | tty_encode_baud_rate(tty, b, b); | ||
242 | } | ||
243 | 239 | ||
244 | switch (termios->c_cflag & CSIZE) { | 240 | switch (termios->c_cflag & CSIZE) { |
245 | case CS5: | 241 | case CS5: |