diff options
Diffstat (limited to 'drivers/net/usb/hso.c')
| -rw-r--r-- | drivers/net/usb/hso.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 62f30b46fa42..605a4baa9b7b 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 */ |
| @@ -2289,9 +2287,11 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, | |||
| 2289 | if (minor < 0) | 2287 | if (minor < 0) |
| 2290 | goto exit; | 2288 | goto exit; |
| 2291 | 2289 | ||
| 2290 | tty_port_init(&serial->port); | ||
| 2291 | |||
| 2292 | /* register our minor number */ | 2292 | /* register our minor number */ |
| 2293 | serial->parent->dev = tty_register_device(tty_drv, minor, | 2293 | serial->parent->dev = tty_port_register_device(&serial->port, tty_drv, |
| 2294 | &serial->parent->interface->dev); | 2294 | minor, &serial->parent->interface->dev); |
| 2295 | dev = serial->parent->dev; | 2295 | dev = serial->parent->dev; |
| 2296 | dev_set_drvdata(dev, serial->parent); | 2296 | dev_set_drvdata(dev, serial->parent); |
| 2297 | i = device_create_file(dev, &dev_attr_hsotype); | 2297 | i = device_create_file(dev, &dev_attr_hsotype); |
| @@ -2300,7 +2300,6 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, | |||
| 2300 | serial->minor = minor; | 2300 | serial->minor = minor; |
| 2301 | serial->magic = HSO_SERIAL_MAGIC; | 2301 | serial->magic = HSO_SERIAL_MAGIC; |
| 2302 | spin_lock_init(&serial->serial_lock); | 2302 | spin_lock_init(&serial->serial_lock); |
| 2303 | tty_port_init(&serial->port); | ||
| 2304 | serial->num_rx_urbs = num_urbs; | 2303 | serial->num_rx_urbs = num_urbs; |
| 2305 | 2304 | ||
| 2306 | /* RX, allocate urb and initialize */ | 2305 | /* RX, allocate urb and initialize */ |
