aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/hso.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-07-14 10:31:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 16:00:41 -0400
commitadc8d746caa67fff4b53ba3e5163a6cbacc3b523 (patch)
treee3f6c05f27c163b369ddd4da5f31d2a61bde6d3a /drivers/net/usb/hso.c
parent6d31a88cb2e01d46c0cb74aa5da529e1f92ae3db (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/net/usb/hso.c')
-rw-r--r--drivers/net/usb/hso.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 62f30b46fa42..7736af75e12b 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -1107,7 +1107,6 @@ static void _hso_serial_set_termios(struct tty_struct *tty,
1107 struct ktermios *old) 1107 struct ktermios *old)
1108{ 1108{
1109 struct hso_serial *serial = tty->driver_data; 1109 struct hso_serial *serial = tty->driver_data;
1110 struct ktermios *termios;
1111 1110
1112 if (!serial) { 1111 if (!serial) {
1113 printk(KERN_ERR "%s: no tty structures", __func__); 1112 printk(KERN_ERR "%s: no tty structures", __func__);
@@ -1119,16 +1118,15 @@ static void _hso_serial_set_termios(struct tty_struct *tty,
1119 /* 1118 /*
1120 * Fix up unsupported bits 1119 * Fix up unsupported bits
1121 */ 1120 */
1122 termios = tty->termios; 1121 tty->termios.c_iflag &= ~IXON; /* disable enable XON/XOFF flow control */
1123 termios->c_iflag &= ~IXON; /* disable enable XON/XOFF flow control */
1124 1122
1125 termios->c_cflag &= 1123 tty->termios.c_cflag &=
1126 ~(CSIZE /* no size */ 1124 ~(CSIZE /* no size */
1127 | PARENB /* disable parity bit */ 1125 | PARENB /* disable parity bit */
1128 | CBAUD /* clear current baud rate */ 1126 | CBAUD /* clear current baud rate */
1129 | CBAUDEX); /* clear current buad rate */ 1127 | CBAUDEX); /* clear current buad rate */
1130 1128
1131 termios->c_cflag |= CS8; /* character size 8 bits */ 1129 tty->termios.c_cflag |= CS8; /* character size 8 bits */
1132 1130
1133 /* baud rate 115200 */ 1131 /* baud rate 115200 */
1134 tty_encode_baud_rate(tty, 115200, 115200); 1132 tty_encode_baud_rate(tty, 115200, 115200);
@@ -1425,14 +1423,14 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
1425 1423
1426 if (old) 1424 if (old)
1427 D5("Termios called with: cflags new[%d] - old[%d]", 1425 D5("Termios called with: cflags new[%d] - old[%d]",
1428 tty->termios->c_cflag, old->c_cflag); 1426 tty->termios.c_cflag, old->c_cflag);
1429 1427
1430 /* the actual setup */ 1428 /* the actual setup */
1431 spin_lock_irqsave(&serial->serial_lock, flags); 1429 spin_lock_irqsave(&serial->serial_lock, flags);
1432 if (serial->port.count) 1430 if (serial->port.count)
1433 _hso_serial_set_termios(tty, old); 1431 _hso_serial_set_termios(tty, old);
1434 else 1432 else
1435 tty->termios = old; 1433 tty->termios = *old;
1436 spin_unlock_irqrestore(&serial->serial_lock, flags); 1434 spin_unlock_irqrestore(&serial->serial_lock, flags);
1437 1435
1438 /* done */ 1436 /* done */