diff options
Diffstat (limited to 'drivers/usb/serial/whiteheat.c')
-rw-r--r-- | drivers/usb/serial/whiteheat.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index a7c3c4734d83..557411c6e7c7 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c | |||
@@ -1434,7 +1434,9 @@ static void rx_data_softint(void *private) | |||
1434 | urb = wrap->urb; | 1434 | urb = wrap->urb; |
1435 | 1435 | ||
1436 | if (tty && urb->actual_length) { | 1436 | if (tty && urb->actual_length) { |
1437 | if (urb->actual_length > TTY_FLIPBUF_SIZE - tty->flip.count) { | 1437 | int len = tty_buffer_request_room(tty, urb->actual_length); |
1438 | /* This stuff can go away now I suspect */ | ||
1439 | if (unlikely(len < urb->actual_length)) { | ||
1438 | spin_lock_irqsave(&info->lock, flags); | 1440 | spin_lock_irqsave(&info->lock, flags); |
1439 | list_add(tmp, &info->rx_urb_q); | 1441 | list_add(tmp, &info->rx_urb_q); |
1440 | spin_unlock_irqrestore(&info->lock, flags); | 1442 | spin_unlock_irqrestore(&info->lock, flags); |
@@ -1442,11 +1444,8 @@ static void rx_data_softint(void *private) | |||
1442 | schedule_work(&info->rx_work); | 1444 | schedule_work(&info->rx_work); |
1443 | return; | 1445 | return; |
1444 | } | 1446 | } |
1445 | 1447 | tty_insert_flip_string(tty, urb->transfer_buffer, len); | |
1446 | memcpy(tty->flip.char_buf_ptr, urb->transfer_buffer, urb->actual_length); | 1448 | sent += len; |
1447 | tty->flip.char_buf_ptr += urb->actual_length; | ||
1448 | tty->flip.count += urb->actual_length; | ||
1449 | sent += urb->actual_length; | ||
1450 | } | 1449 | } |
1451 | 1450 | ||
1452 | urb->dev = port->serial->dev; | 1451 | urb->dev = port->serial->dev; |