diff options
Diffstat (limited to 'drivers/usb/serial/digi_acceleport.c')
| -rw-r--r-- | drivers/usb/serial/digi_acceleport.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 45d4af62967f..ebe45fa0ed50 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c | |||
| @@ -1399,9 +1399,7 @@ static void digi_read_bulk_callback(struct urb *urb) | |||
| 1399 | 1399 | ||
| 1400 | static int digi_read_inb_callback(struct urb *urb) | 1400 | static int digi_read_inb_callback(struct urb *urb) |
| 1401 | { | 1401 | { |
| 1402 | |||
| 1403 | struct usb_serial_port *port = urb->context; | 1402 | struct usb_serial_port *port = urb->context; |
| 1404 | struct tty_struct *tty; | ||
| 1405 | struct digi_port *priv = usb_get_serial_port_data(port); | 1403 | struct digi_port *priv = usb_get_serial_port_data(port); |
| 1406 | int opcode = ((unsigned char *)urb->transfer_buffer)[0]; | 1404 | int opcode = ((unsigned char *)urb->transfer_buffer)[0]; |
| 1407 | int len = ((unsigned char *)urb->transfer_buffer)[1]; | 1405 | int len = ((unsigned char *)urb->transfer_buffer)[1]; |
| @@ -1425,7 +1423,6 @@ static int digi_read_inb_callback(struct urb *urb) | |||
| 1425 | return -1; | 1423 | return -1; |
| 1426 | } | 1424 | } |
| 1427 | 1425 | ||
| 1428 | tty = tty_port_tty_get(&port->port); | ||
| 1429 | spin_lock(&priv->dp_port_lock); | 1426 | spin_lock(&priv->dp_port_lock); |
| 1430 | 1427 | ||
| 1431 | /* check for throttle; if set, do not resubmit read urb */ | 1428 | /* check for throttle; if set, do not resubmit read urb */ |
| @@ -1435,13 +1432,13 @@ static int digi_read_inb_callback(struct urb *urb) | |||
| 1435 | priv->dp_throttle_restart = 1; | 1432 | priv->dp_throttle_restart = 1; |
| 1436 | 1433 | ||
| 1437 | /* receive data */ | 1434 | /* receive data */ |
| 1438 | if (tty && opcode == DIGI_CMD_RECEIVE_DATA) { | 1435 | if (opcode == DIGI_CMD_RECEIVE_DATA) { |
| 1439 | /* get flag from port_status */ | 1436 | /* get flag from port_status */ |
| 1440 | flag = 0; | 1437 | flag = 0; |
| 1441 | 1438 | ||
| 1442 | /* overrun is special, not associated with a char */ | 1439 | /* overrun is special, not associated with a char */ |
| 1443 | if (port_status & DIGI_OVERRUN_ERROR) | 1440 | if (port_status & DIGI_OVERRUN_ERROR) |
| 1444 | tty_insert_flip_char(tty, 0, TTY_OVERRUN); | 1441 | tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); |
| 1445 | 1442 | ||
| 1446 | /* break takes precedence over parity, */ | 1443 | /* break takes precedence over parity, */ |
| 1447 | /* which takes precedence over framing errors */ | 1444 | /* which takes precedence over framing errors */ |
| @@ -1455,13 +1452,12 @@ static int digi_read_inb_callback(struct urb *urb) | |||
| 1455 | /* data length is len-1 (one byte of len is port_status) */ | 1452 | /* data length is len-1 (one byte of len is port_status) */ |
| 1456 | --len; | 1453 | --len; |
| 1457 | if (len > 0) { | 1454 | if (len > 0) { |
| 1458 | tty_insert_flip_string_fixed_flag(tty, data, flag, | 1455 | tty_insert_flip_string_fixed_flag(&port->port, data, |
| 1459 | len); | 1456 | flag, len); |
| 1460 | tty_flip_buffer_push(tty); | 1457 | tty_flip_buffer_push(&port->port); |
| 1461 | } | 1458 | } |
| 1462 | } | 1459 | } |
| 1463 | spin_unlock(&priv->dp_port_lock); | 1460 | spin_unlock(&priv->dp_port_lock); |
| 1464 | tty_kref_put(tty); | ||
| 1465 | 1461 | ||
| 1466 | if (opcode == DIGI_CMD_RECEIVE_DISABLE) | 1462 | if (opcode == DIGI_CMD_RECEIVE_DISABLE) |
| 1467 | dev_dbg(&port->dev, "%s: got RECEIVE_DISABLE\n", __func__); | 1463 | dev_dbg(&port->dev, "%s: got RECEIVE_DISABLE\n", __func__); |
