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/tty/mxser.c | |
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/tty/mxser.c')
-rw-r--r-- | drivers/tty/mxser.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 90cc680c4f0e..c162ee931167 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c | |||
@@ -643,7 +643,7 @@ static int mxser_change_speed(struct tty_struct *tty, | |||
643 | int ret = 0; | 643 | int ret = 0; |
644 | unsigned char status; | 644 | unsigned char status; |
645 | 645 | ||
646 | cflag = tty->termios->c_cflag; | 646 | cflag = tty->termios.c_cflag; |
647 | if (!info->ioaddr) | 647 | if (!info->ioaddr) |
648 | return ret; | 648 | return ret; |
649 | 649 | ||
@@ -1520,10 +1520,10 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp) | |||
1520 | 1520 | ||
1521 | tty = tty_port_tty_get(port); | 1521 | tty = tty_port_tty_get(port); |
1522 | 1522 | ||
1523 | if (!tty || !tty->termios) | 1523 | if (!tty) |
1524 | ms.cflag = ip->normal_termios.c_cflag; | 1524 | ms.cflag = ip->normal_termios.c_cflag; |
1525 | else | 1525 | else |
1526 | ms.cflag = tty->termios->c_cflag; | 1526 | ms.cflag = tty->termios.c_cflag; |
1527 | tty_kref_put(tty); | 1527 | tty_kref_put(tty); |
1528 | spin_lock_irq(&ip->slock); | 1528 | spin_lock_irq(&ip->slock); |
1529 | status = inb(ip->ioaddr + UART_MSR); | 1529 | status = inb(ip->ioaddr + UART_MSR); |
@@ -1589,13 +1589,13 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp) | |||
1589 | 1589 | ||
1590 | tty = tty_port_tty_get(&ip->port); | 1590 | tty = tty_port_tty_get(&ip->port); |
1591 | 1591 | ||
1592 | if (!tty || !tty->termios) { | 1592 | if (!tty) { |
1593 | cflag = ip->normal_termios.c_cflag; | 1593 | cflag = ip->normal_termios.c_cflag; |
1594 | iflag = ip->normal_termios.c_iflag; | 1594 | iflag = ip->normal_termios.c_iflag; |
1595 | me->baudrate[p] = tty_termios_baud_rate(&ip->normal_termios); | 1595 | me->baudrate[p] = tty_termios_baud_rate(&ip->normal_termios); |
1596 | } else { | 1596 | } else { |
1597 | cflag = tty->termios->c_cflag; | 1597 | cflag = tty->termios.c_cflag; |
1598 | iflag = tty->termios->c_iflag; | 1598 | iflag = tty->termios.c_iflag; |
1599 | me->baudrate[p] = tty_get_baud_rate(tty); | 1599 | me->baudrate[p] = tty_get_baud_rate(tty); |
1600 | } | 1600 | } |
1601 | tty_kref_put(tty); | 1601 | tty_kref_put(tty); |
@@ -1853,7 +1853,7 @@ static void mxser_stoprx(struct tty_struct *tty) | |||
1853 | } | 1853 | } |
1854 | } | 1854 | } |
1855 | 1855 | ||
1856 | if (tty->termios->c_cflag & CRTSCTS) { | 1856 | if (tty->termios.c_cflag & CRTSCTS) { |
1857 | info->MCR &= ~UART_MCR_RTS; | 1857 | info->MCR &= ~UART_MCR_RTS; |
1858 | outb(info->MCR, info->ioaddr + UART_MCR); | 1858 | outb(info->MCR, info->ioaddr + UART_MCR); |
1859 | } | 1859 | } |
@@ -1890,7 +1890,7 @@ static void mxser_unthrottle(struct tty_struct *tty) | |||
1890 | } | 1890 | } |
1891 | } | 1891 | } |
1892 | 1892 | ||
1893 | if (tty->termios->c_cflag & CRTSCTS) { | 1893 | if (tty->termios.c_cflag & CRTSCTS) { |
1894 | info->MCR |= UART_MCR_RTS; | 1894 | info->MCR |= UART_MCR_RTS; |
1895 | outb(info->MCR, info->ioaddr + UART_MCR); | 1895 | outb(info->MCR, info->ioaddr + UART_MCR); |
1896 | } | 1896 | } |
@@ -1939,14 +1939,14 @@ static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termi | |||
1939 | spin_unlock_irqrestore(&info->slock, flags); | 1939 | spin_unlock_irqrestore(&info->slock, flags); |
1940 | 1940 | ||
1941 | if ((old_termios->c_cflag & CRTSCTS) && | 1941 | if ((old_termios->c_cflag & CRTSCTS) && |
1942 | !(tty->termios->c_cflag & CRTSCTS)) { | 1942 | !(tty->termios.c_cflag & CRTSCTS)) { |
1943 | tty->hw_stopped = 0; | 1943 | tty->hw_stopped = 0; |
1944 | mxser_start(tty); | 1944 | mxser_start(tty); |
1945 | } | 1945 | } |
1946 | 1946 | ||
1947 | /* Handle sw stopped */ | 1947 | /* Handle sw stopped */ |
1948 | if ((old_termios->c_iflag & IXON) && | 1948 | if ((old_termios->c_iflag & IXON) && |
1949 | !(tty->termios->c_iflag & IXON)) { | 1949 | !(tty->termios.c_iflag & IXON)) { |
1950 | tty->stopped = 0; | 1950 | tty->stopped = 0; |
1951 | 1951 | ||
1952 | if (info->board->chip_flag) { | 1952 | if (info->board->chip_flag) { |