diff options
author | Alan Cox <alan@linux.intel.com> | 2012-07-14 10:31:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-16 16:00:41 -0400 |
commit | adc8d746caa67fff4b53ba3e5163a6cbacc3b523 (patch) | |
tree | e3f6c05f27c163b369ddd4da5f31d2a61bde6d3a /drivers/isdn | |
parent | 6d31a88cb2e01d46c0cb74aa5da529e1f92ae3db (diff) |
tty: move the termios object into the tty
This will let us sort out a whole pile of tty related races. The
alternative would be to keep points and refcount the termios objects.
However
1. They are tiny anyway
2. Many devices don't use the stored copies
3. We can remove a pty special case
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/gigaset/interface.c | 4 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_tty.c | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index a6d9fd2858f7..f9aab7490868 100644 --- a/drivers/isdn/gigaset/interface.c +++ b/drivers/isdn/gigaset/interface.c | |||
@@ -446,8 +446,8 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old) | |||
446 | goto out; | 446 | goto out; |
447 | } | 447 | } |
448 | 448 | ||
449 | iflag = tty->termios->c_iflag; | 449 | iflag = tty->termios.c_iflag; |
450 | cflag = tty->termios->c_cflag; | 450 | cflag = tty->termios.c_cflag; |
451 | old_cflag = old ? old->c_cflag : cflag; | 451 | old_cflag = old ? old->c_cflag : cflag; |
452 | gig_dbg(DEBUG_IF, "%u: iflag %x cflag %x old %x", | 452 | gig_dbg(DEBUG_IF, "%u: iflag %x cflag %x old %x", |
453 | cs->minor_index, iflag, cflag, old_cflag); | 453 | cs->minor_index, iflag, cflag, old_cflag); |
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 7bc50670d7d9..7a61ef6cffaa 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c | |||
@@ -1009,15 +1009,15 @@ isdn_tty_change_speed(modem_info *info) | |||
1009 | quot; | 1009 | quot; |
1010 | int i; | 1010 | int i; |
1011 | 1011 | ||
1012 | if (!port->tty || !port->tty->termios) | 1012 | if (!port->tty) |
1013 | return; | 1013 | return; |
1014 | cflag = port->tty->termios->c_cflag; | 1014 | cflag = port->tty->termios.c_cflag; |
1015 | 1015 | ||
1016 | quot = i = cflag & CBAUD; | 1016 | quot = i = cflag & CBAUD; |
1017 | if (i & CBAUDEX) { | 1017 | if (i & CBAUDEX) { |
1018 | i &= ~CBAUDEX; | 1018 | i &= ~CBAUDEX; |
1019 | if (i < 1 || i > 2) | 1019 | if (i < 1 || i > 2) |
1020 | port->tty->termios->c_cflag &= ~CBAUDEX; | 1020 | port->tty->termios.c_cflag &= ~CBAUDEX; |
1021 | else | 1021 | else |
1022 | i += 15; | 1022 | i += 15; |
1023 | } | 1023 | } |
@@ -1097,7 +1097,7 @@ isdn_tty_shutdown(modem_info *info) | |||
1097 | #endif | 1097 | #endif |
1098 | isdn_unlock_drivers(); | 1098 | isdn_unlock_drivers(); |
1099 | info->msr &= ~UART_MSR_RI; | 1099 | info->msr &= ~UART_MSR_RI; |
1100 | if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL)) { | 1100 | if (!info->port.tty || (info->port.tty->termios.c_cflag & HUPCL)) { |
1101 | info->mcr &= ~(UART_MCR_DTR | UART_MCR_RTS); | 1101 | info->mcr &= ~(UART_MCR_DTR | UART_MCR_RTS); |
1102 | if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) { | 1102 | if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) { |
1103 | isdn_tty_modem_reset_regs(info, 0); | 1103 | isdn_tty_modem_reset_regs(info, 0); |
@@ -1469,13 +1469,13 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) | |||
1469 | if (!old_termios) | 1469 | if (!old_termios) |
1470 | isdn_tty_change_speed(info); | 1470 | isdn_tty_change_speed(info); |
1471 | else { | 1471 | else { |
1472 | if (tty->termios->c_cflag == old_termios->c_cflag && | 1472 | if (tty->termios.c_cflag == old_termios->c_cflag && |
1473 | tty->termios->c_ispeed == old_termios->c_ispeed && | 1473 | tty->termios.c_ispeed == old_termios->c_ispeed && |
1474 | tty->termios->c_ospeed == old_termios->c_ospeed) | 1474 | tty->termios.c_ospeed == old_termios->c_ospeed) |
1475 | return; | 1475 | return; |
1476 | isdn_tty_change_speed(info); | 1476 | isdn_tty_change_speed(info); |
1477 | if ((old_termios->c_cflag & CRTSCTS) && | 1477 | if ((old_termios->c_cflag & CRTSCTS) && |
1478 | !(tty->termios->c_cflag & CRTSCTS)) | 1478 | !(tty->termios.c_cflag & CRTSCTS)) |
1479 | tty->hw_stopped = 0; | 1479 | tty->hw_stopped = 0; |
1480 | } | 1480 | } |
1481 | } | 1481 | } |