aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/max3100.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/max3100.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/max3100.c')
-rw-r--r--drivers/serial/max3100.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/serial/max3100.c b/drivers/serial/max3100.c
index 3351c3bd59e4..beb1afa27d8d 100644
--- a/drivers/serial/max3100.c
+++ b/drivers/serial/max3100.c
@@ -430,17 +430,14 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
430 int baud = 0; 430 int baud = 0;
431 unsigned cflag; 431 unsigned cflag;
432 u32 param_new, param_mask, parity = 0; 432 u32 param_new, param_mask, parity = 0;
433 struct tty_struct *tty = s->port.state->port.tty;
434 433
435 dev_dbg(&s->spi->dev, "%s\n", __func__); 434 dev_dbg(&s->spi->dev, "%s\n", __func__);
436 if (!tty)
437 return;
438 435
439 cflag = termios->c_cflag; 436 cflag = termios->c_cflag;
440 param_new = 0; 437 param_new = 0;
441 param_mask = 0; 438 param_mask = 0;
442 439
443 baud = tty_get_baud_rate(tty); 440 baud = tty_termios_baud_rate(termios);
444 param_new = s->conf & MAX3100_BAUD; 441 param_new = s->conf & MAX3100_BAUD;
445 switch (baud) { 442 switch (baud) {
446 case 300: 443 case 300:
@@ -485,7 +482,7 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
485 default: 482 default:
486 baud = s->baud; 483 baud = s->baud;
487 } 484 }
488 tty_encode_baud_rate(tty, baud, baud); 485 tty_termios_encode_baud_rate(termios, baud, baud);
489 s->baud = baud; 486 s->baud = baud;
490 param_mask |= MAX3100_BAUD; 487 param_mask |= MAX3100_BAUD;
491 488