aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-02-18 11:44:01 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:55:12 -0500
commita108bfcb372d8c4452701039308fb95747911c59 (patch)
tree3528621937692e28081f71131cddc3130e2641ad /drivers/usb
parent2832fc11f1360668482beec06dbcd631ae5f0cf1 (diff)
USB: tty: Prune uses of tty_request_room in the USB layer
We have lots of callers that do not need to do this in the first place. Remove the calls as they both cost CPU and for big buffers can mess up the multi-page allocation avoidance. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/ark3116.c1
-rw-r--r--drivers/usb/serial/cyberjack.c1
-rw-r--r--drivers/usb/serial/cypress_m8.c10
-rw-r--r--drivers/usb/serial/digi_acceleport.c13
-rw-r--r--drivers/usb/serial/empeg.c1
-rw-r--r--drivers/usb/serial/garmin_gps.c1
-rw-r--r--drivers/usb/serial/io_edgeport.c19
-rw-r--r--drivers/usb/serial/io_ti.c1
-rw-r--r--drivers/usb/serial/ipaq.c1
-rw-r--r--drivers/usb/serial/ipw.c1
-rw-r--r--drivers/usb/serial/ir-usb.c6
-rw-r--r--drivers/usb/serial/kl5kusb105.c1
-rw-r--r--drivers/usb/serial/kobil_sct.c1
-rw-r--r--drivers/usb/serial/mos7720.c1
-rw-r--r--drivers/usb/serial/mos7840.c1
-rw-r--r--drivers/usb/serial/navman.c1
-rw-r--r--drivers/usb/serial/opticon.c11
-rw-r--r--drivers/usb/serial/option.c1
-rw-r--r--drivers/usb/serial/pl2303.c1
-rw-r--r--drivers/usb/serial/sierra.c2
-rw-r--r--drivers/usb/serial/spcp8x5.c6
-rw-r--r--drivers/usb/serial/symbolserial.c10
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c3
-rw-r--r--drivers/usb/serial/visor.c10
24 files changed, 25 insertions, 79 deletions
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index 1f75fac81232..547c9448c28c 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -733,7 +733,6 @@ static void ark3116_read_bulk_callback(struct urb *urb)
733 733
734 tty = tty_port_tty_get(&port->port); 734 tty = tty_port_tty_get(&port->port);
735 if (tty) { 735 if (tty) {
736 tty_buffer_request_room(tty, urb->actual_length + 1);
737 /* overrun is special, not associated with a char */ 736 /* overrun is special, not associated with a char */
738 if (unlikely(lsr & UART_LSR_OE)) 737 if (unlikely(lsr & UART_LSR_OE))
739 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 738 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 036f9996fe52..f744ab7a3b19 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -395,7 +395,6 @@ static void cyberjack_read_bulk_callback(struct urb *urb)
395 return; 395 return;
396 } 396 }
397 if (urb->actual_length) { 397 if (urb->actual_length) {
398 tty_buffer_request_room(tty, urb->actual_length);
399 tty_insert_flip_string(tty, data, urb->actual_length); 398 tty_insert_flip_string(tty, data, urb->actual_length);
400 tty_flip_buffer_push(tty); 399 tty_flip_buffer_push(tty);
401 } 400 }
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index c349f790f856..3a5d57f89dee 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -1307,13 +1307,9 @@ static void cypress_read_int_callback(struct urb *urb)
1307 spin_unlock_irqrestore(&priv->lock, flags); 1307 spin_unlock_irqrestore(&priv->lock, flags);
1308 1308
1309 /* process read if there is data other than line status */ 1309 /* process read if there is data other than line status */
1310 if (tty && (bytes > i)) { 1310 if (tty && bytes > i) {
1311 bytes = tty_buffer_request_room(tty, bytes); 1311 tty_insert_flip_string_fixed_flag(tty, data + i,
1312 for (; i < bytes ; ++i) { 1312 bytes - i, tty_flag);
1313 dbg("pushing byte number %d - %d - %c", i, data[i],
1314 data[i]);
1315 tty_insert_flip_char(tty, data[i], tty_flag);
1316 }
1317 tty_flip_buffer_push(tty); 1313 tty_flip_buffer_push(tty);
1318 } 1314 }
1319 1315
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 3b6348414c47..381722858424 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -1658,7 +1658,6 @@ static int digi_read_inb_callback(struct urb *urb)
1658 int port_status = ((unsigned char *)urb->transfer_buffer)[2]; 1658 int port_status = ((unsigned char *)urb->transfer_buffer)[2];
1659 unsigned char *data = ((unsigned char *)urb->transfer_buffer) + 3; 1659 unsigned char *data = ((unsigned char *)urb->transfer_buffer) + 3;
1660 int flag, throttled; 1660 int flag, throttled;
1661 int i;
1662 int status = urb->status; 1661 int status = urb->status;
1663 1662
1664 /* do not process callbacks on closed ports */ 1663 /* do not process callbacks on closed ports */
@@ -1705,17 +1704,9 @@ static int digi_read_inb_callback(struct urb *urb)
1705 1704
1706 /* data length is len-1 (one byte of len is port_status) */ 1705 /* data length is len-1 (one byte of len is port_status) */
1707 --len; 1706 --len;
1708
1709 len = tty_buffer_request_room(tty, len);
1710 if (len > 0) { 1707 if (len > 0) {
1711 /* Hot path */ 1708 tty_insert_flip_string_fixed_flag(tty, data, len,
1712 if (flag == TTY_NORMAL) 1709 flag);
1713 tty_insert_flip_string(tty, data, len);
1714 else {
1715 for (i = 0; i < len; i++)
1716 tty_insert_flip_char(tty,
1717 data[i], flag);
1718 }
1719 tty_flip_buffer_push(tty); 1710 tty_flip_buffer_push(tty);
1720 } 1711 }
1721 } 1712 }
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index d02e604e9cc4..5f740a1eacab 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -346,7 +346,6 @@ static void empeg_read_bulk_callback(struct urb *urb)
346 tty = tty_port_tty_get(&port->port); 346 tty = tty_port_tty_get(&port->port);
347 347
348 if (urb->actual_length) { 348 if (urb->actual_length) {
349 tty_buffer_request_room(tty, urb->actual_length);
350 tty_insert_flip_string(tty, data, urb->actual_length); 349 tty_insert_flip_string(tty, data, urb->actual_length);
351 tty_flip_buffer_push(tty); 350 tty_flip_buffer_push(tty);
352 bytes_in += urb->actual_length; 351 bytes_in += urb->actual_length;
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index 6bbedfbb0fbc..a42b29a695b2 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -271,7 +271,6 @@ static void send_to_tty(struct usb_serial_port *port,
271 usb_serial_debug_data(debug, &port->dev, 271 usb_serial_debug_data(debug, &port->dev,
272 __func__, actual_length, data); 272 __func__, actual_length, data);
273 273
274 tty_buffer_request_room(tty, actual_length);
275 tty_insert_flip_string(tty, data, actual_length); 274 tty_insert_flip_string(tty, data, actual_length);
276 tty_flip_buffer_push(tty); 275 tty_flip_buffer_push(tty);
277 } 276 }
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 66fb58f427cd..3ef8df0ef888 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -2055,18 +2055,13 @@ static void edge_tty_recv(struct device *dev, struct tty_struct *tty,
2055{ 2055{
2056 int cnt; 2056 int cnt;
2057 2057
2058 do { 2058 cnt = tty_insert_flip_string(tty, data, length);
2059 cnt = tty_buffer_request_room(tty, length); 2059 if (cnt < length) {
2060 if (cnt < length) { 2060 dev_err(dev, "%s - dropping data, %d bytes lost\n",
2061 dev_err(dev, "%s - dropping data, %d bytes lost\n", 2061 __func__, length - cnt);
2062 __func__, length - cnt); 2062 }
2063 if (cnt == 0) 2063 data += cnt;
2064 break; 2064 length -= cnt;
2065 }
2066 tty_insert_flip_string(tty, data, cnt);
2067 data += cnt;
2068 length -= cnt;
2069 } while (length > 0);
2070 2065
2071 tty_flip_buffer_push(tty); 2066 tty_flip_buffer_push(tty);
2072} 2067}
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 98e50456ad79..aa876f71f228 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -1820,7 +1820,6 @@ static void edge_tty_recv(struct device *dev, struct tty_struct *tty,
1820{ 1820{
1821 int queued; 1821 int queued;
1822 1822
1823 tty_buffer_request_room(tty, length);
1824 queued = tty_insert_flip_string(tty, data, length); 1823 queued = tty_insert_flip_string(tty, data, length);
1825 if (queued < length) 1824 if (queued < length)
1826 dev_err(dev, "%s - dropping data, %d bytes lost\n", 1825 dev_err(dev, "%s - dropping data, %d bytes lost\n",
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index d6231c38813e..3fea9298eb15 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -747,7 +747,6 @@ static void ipaq_read_bulk_callback(struct urb *urb)
747 747
748 tty = tty_port_tty_get(&port->port); 748 tty = tty_port_tty_get(&port->port);
749 if (tty && urb->actual_length) { 749 if (tty && urb->actual_length) {
750 tty_buffer_request_room(tty, urb->actual_length);
751 tty_insert_flip_string(tty, data, urb->actual_length); 750 tty_insert_flip_string(tty, data, urb->actual_length);
752 tty_flip_buffer_push(tty); 751 tty_flip_buffer_push(tty);
753 bytes_in += urb->actual_length; 752 bytes_in += urb->actual_length;
diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index c0afa7a219d7..e1d07840cee6 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -172,7 +172,6 @@ static void ipw_read_bulk_callback(struct urb *urb)
172 172
173 tty = tty_port_tty_get(&port->port); 173 tty = tty_port_tty_get(&port->port);
174 if (tty && urb->actual_length) { 174 if (tty && urb->actual_length) {
175 tty_buffer_request_room(tty, urb->actual_length);
176 tty_insert_flip_string(tty, data, urb->actual_length); 175 tty_insert_flip_string(tty, data, urb->actual_length);
177 tty_flip_buffer_push(tty); 176 tty_flip_buffer_push(tty);
178 } 177 }
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index fc2ab81a48d1..c3e5d506aead 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -462,10 +462,8 @@ static void ir_read_bulk_callback(struct urb *urb)
462 usb_serial_debug_data(debug, &port->dev, __func__, 462 usb_serial_debug_data(debug, &port->dev, __func__,
463 urb->actual_length, data); 463 urb->actual_length, data);
464 tty = tty_port_tty_get(&port->port); 464 tty = tty_port_tty_get(&port->port);
465 if (tty_buffer_request_room(tty, urb->actual_length - 1)) { 465 tty_insert_flip_string(tty, data+1, urb->actual_length - 1);
466 tty_insert_flip_string(tty, data+1, urb->actual_length - 1); 466 tty_flip_buffer_push(tty);
467 tty_flip_buffer_push(tty);
468 }
469 tty_kref_put(tty); 467 tty_kref_put(tty);
470 468
471 /* 469 /*
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 2dbe22ae50fc..8eef91ba4b1c 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -699,7 +699,6 @@ static void klsi_105_read_bulk_callback(struct urb *urb)
699 bytes_sent = urb->actual_length - 2; 699 bytes_sent = urb->actual_length - 2;
700 } 700 }
701 701
702 tty_buffer_request_room(tty, bytes_sent);
703 tty_insert_flip_string(tty, data + 2, bytes_sent); 702 tty_insert_flip_string(tty, data + 2, bytes_sent);
704 tty_flip_buffer_push(tty); 703 tty_flip_buffer_push(tty);
705 tty_kref_put(tty); 704 tty_kref_put(tty);
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index fc7855388e27..c113a2a0e10c 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -388,7 +388,6 @@ static void kobil_read_int_callback(struct urb *urb)
388 */ 388 */
389 /* END DEBUG */ 389 /* END DEBUG */
390 390
391 tty_buffer_request_room(tty, urb->actual_length);
392 tty_insert_flip_string(tty, data, urb->actual_length); 391 tty_insert_flip_string(tty, data, urb->actual_length);
393 tty_flip_buffer_push(tty); 392 tty_flip_buffer_push(tty);
394 } 393 }
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 546b29f73c2c..0d47f2c4d59f 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -290,7 +290,6 @@ static void mos7720_bulk_in_callback(struct urb *urb)
290 290
291 tty = tty_port_tty_get(&port->port); 291 tty = tty_port_tty_get(&port->port);
292 if (tty && urb->actual_length) { 292 if (tty && urb->actual_length) {
293 tty_buffer_request_room(tty, urb->actual_length);
294 tty_insert_flip_string(tty, data, urb->actual_length); 293 tty_insert_flip_string(tty, data, urb->actual_length);
295 tty_flip_buffer_push(tty); 294 tty_flip_buffer_push(tty);
296 } 295 }
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index c89a89c6394e..2fda1c0182b7 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -764,7 +764,6 @@ static void mos7840_bulk_in_callback(struct urb *urb)
764 if (urb->actual_length) { 764 if (urb->actual_length) {
765 tty = tty_port_tty_get(&mos7840_port->port->port); 765 tty = tty_port_tty_get(&mos7840_port->port->port);
766 if (tty) { 766 if (tty) {
767 tty_buffer_request_room(tty, urb->actual_length);
768 tty_insert_flip_string(tty, data, urb->actual_length); 767 tty_insert_flip_string(tty, data, urb->actual_length);
769 dbg(" %s ", data); 768 dbg(" %s ", data);
770 tty_flip_buffer_push(tty); 769 tty_flip_buffer_push(tty);
diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c
index efa61bcd3297..04a6cbbed2c0 100644
--- a/drivers/usb/serial/navman.c
+++ b/drivers/usb/serial/navman.c
@@ -66,7 +66,6 @@ static void navman_read_int_callback(struct urb *urb)
66 66
67 tty = tty_port_tty_get(&port->port); 67 tty = tty_port_tty_get(&port->port);
68 if (tty && urb->actual_length) { 68 if (tty && urb->actual_length) {
69 tty_buffer_request_room(tty, urb->actual_length);
70 tty_insert_flip_string(tty, data, urb->actual_length); 69 tty_insert_flip_string(tty, data, urb->actual_length);
71 tty_flip_buffer_push(tty); 70 tty_flip_buffer_push(tty);
72 } 71 }
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index 773286672ec9..f37476e22684 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -55,7 +55,6 @@ static void opticon_bulk_callback(struct urb *urb)
55 int status = urb->status; 55 int status = urb->status;
56 struct tty_struct *tty; 56 struct tty_struct *tty;
57 int result; 57 int result;
58 int available_room = 0;
59 int data_length; 58 int data_length;
60 59
61 dbg("%s - port %d", __func__, port->number); 60 dbg("%s - port %d", __func__, port->number);
@@ -96,13 +95,9 @@ static void opticon_bulk_callback(struct urb *urb)
96 /* real data, send it to the tty layer */ 95 /* real data, send it to the tty layer */
97 tty = tty_port_tty_get(&port->port); 96 tty = tty_port_tty_get(&port->port);
98 if (tty) { 97 if (tty) {
99 available_room = tty_buffer_request_room(tty, 98 tty_insert_flip_string(tty, data,
100 data_length); 99 data_length);
101 if (available_room) { 100 tty_flip_buffer_push(tty);
102 tty_insert_flip_string(tty, data,
103 available_room);
104 tty_flip_buffer_push(tty);
105 }
106 tty_kref_put(tty); 101 tty_kref_put(tty);
107 } 102 }
108 } else { 103 } else {
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index f6646b30f954..68c7457a98ae 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -964,7 +964,6 @@ static void option_indat_callback(struct urb *urb)
964 } else { 964 } else {
965 tty = tty_port_tty_get(&port->port); 965 tty = tty_port_tty_get(&port->port);
966 if (urb->actual_length) { 966 if (urb->actual_length) {
967 tty_buffer_request_room(tty, urb->actual_length);
968 tty_insert_flip_string(tty, data, urb->actual_length); 967 tty_insert_flip_string(tty, data, urb->actual_length);
969 tty_flip_buffer_push(tty); 968 tty_flip_buffer_push(tty);
970 } else 969 } else
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 767000c70149..a3e5a56dc066 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -1042,7 +1042,6 @@ static void pl2303_push_data(struct tty_struct *tty,
1042 tty_flag = TTY_FRAME; 1042 tty_flag = TTY_FRAME;
1043 dbg("%s - tty_flag = %d", __func__, tty_flag); 1043 dbg("%s - tty_flag = %d", __func__, tty_flag);
1044 1044
1045 tty_buffer_request_room(tty, urb->actual_length + 1);
1046 /* overrun is special, not associated with a char */ 1045 /* overrun is special, not associated with a char */
1047 if (line_status & UART_OVERRUN_ERROR) 1046 if (line_status & UART_OVERRUN_ERROR)
1048 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 1047 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index fcec46603558..c012e51665bd 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -595,8 +595,6 @@ static void sierra_indat_callback(struct urb *urb)
595 if (urb->actual_length) { 595 if (urb->actual_length) {
596 tty = tty_port_tty_get(&port->port); 596 tty = tty_port_tty_get(&port->port);
597 if (tty) { 597 if (tty) {
598 tty_buffer_request_room(tty,
599 urb->actual_length);
600 tty_insert_flip_string(tty, data, 598 tty_insert_flip_string(tty, data,
601 urb->actual_length); 599 urb->actual_length);
602 tty_flip_buffer_push(tty); 600 tty_flip_buffer_push(tty);
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
index 067e95ad2987..cf508e26f1c6 100644
--- a/drivers/usb/serial/spcp8x5.c
+++ b/drivers/usb/serial/spcp8x5.c
@@ -677,7 +677,6 @@ static void spcp8x5_read_bulk_callback(struct urb *urb)
677 struct tty_struct *tty; 677 struct tty_struct *tty;
678 unsigned char *data = urb->transfer_buffer; 678 unsigned char *data = urb->transfer_buffer;
679 unsigned long flags; 679 unsigned long flags;
680 int i;
681 int result = urb->status; 680 int result = urb->status;
682 u8 status; 681 u8 status;
683 char tty_flag; 682 char tty_flag;
@@ -726,12 +725,11 @@ static void spcp8x5_read_bulk_callback(struct urb *urb)
726 725
727 tty = tty_port_tty_get(&port->port); 726 tty = tty_port_tty_get(&port->port);
728 if (tty && urb->actual_length) { 727 if (tty && urb->actual_length) {
729 tty_buffer_request_room(tty, urb->actual_length + 1);
730 /* overrun is special, not associated with a char */ 728 /* overrun is special, not associated with a char */
731 if (status & UART_OVERRUN_ERROR) 729 if (status & UART_OVERRUN_ERROR)
732 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 730 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
733 for (i = 0; i < urb->actual_length; ++i) 731 tty_insert_flip_string_fixed_flag(tty, data,
734 tty_insert_flip_char(tty, data[i], tty_flag); 732 urb->actual_length, tty_flag);
735 tty_flip_buffer_push(tty); 733 tty_flip_buffer_push(tty);
736 } 734 }
737 tty_kref_put(tty); 735 tty_kref_put(tty);
diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c
index 1a76bc5261e9..72398888858f 100644
--- a/drivers/usb/serial/symbolserial.c
+++ b/drivers/usb/serial/symbolserial.c
@@ -51,7 +51,6 @@ static void symbol_int_callback(struct urb *urb)
51 int status = urb->status; 51 int status = urb->status;
52 struct tty_struct *tty; 52 struct tty_struct *tty;
53 int result; 53 int result;
54 int available_room = 0;
55 int data_length; 54 int data_length;
56 55
57 dbg("%s - port %d", __func__, port->number); 56 dbg("%s - port %d", __func__, port->number);
@@ -89,13 +88,8 @@ static void symbol_int_callback(struct urb *urb)
89 */ 88 */
90 tty = tty_port_tty_get(&port->port); 89 tty = tty_port_tty_get(&port->port);
91 if (tty) { 90 if (tty) {
92 available_room = tty_buffer_request_room(tty, 91 tty_insert_flip_string(tty, &data[1], data_length);
93 data_length); 92 tty_flip_buffer_push(tty);
94 if (available_room) {
95 tty_insert_flip_string(tty, &data[1],
96 available_room);
97 tty_flip_buffer_push(tty);
98 }
99 tty_kref_put(tty); 93 tty_kref_put(tty);
100 } 94 }
101 } else { 95 } else {
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 1e9dc8821698..0afe5c71c17e 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1271,14 +1271,13 @@ static void ti_recv(struct device *dev, struct tty_struct *tty,
1271 int cnt; 1271 int cnt;
1272 1272
1273 do { 1273 do {
1274 cnt = tty_buffer_request_room(tty, length); 1274 cnt = tty_insert_flip_string(tty, data, length);
1275 if (cnt < length) { 1275 if (cnt < length) {
1276 dev_err(dev, "%s - dropping data, %d bytes lost\n", 1276 dev_err(dev, "%s - dropping data, %d bytes lost\n",
1277 __func__, length - cnt); 1277 __func__, length - cnt);
1278 if (cnt == 0) 1278 if (cnt == 0)
1279 break; 1279 break;
1280 } 1280 }
1281 tty_insert_flip_string(tty, data, cnt);
1282 tty_flip_buffer_push(tty); 1281 tty_flip_buffer_push(tty);
1283 data += cnt; 1282 data += cnt;
1284 length -= cnt; 1283 length -= cnt;
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 4f7945e672cc..094942707c7d 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -503,13 +503,9 @@ static void visor_read_bulk_callback(struct urb *urb)
503 if (urb->actual_length) { 503 if (urb->actual_length) {
504 tty = tty_port_tty_get(&port->port); 504 tty = tty_port_tty_get(&port->port);
505 if (tty) { 505 if (tty) {
506 available_room = tty_buffer_request_room(tty, 506 tty_insert_flip_string(tty, data,
507 urb->actual_length); 507 urb->actual_length);
508 if (available_room) { 508 tty_flip_buffer_push(tty);
509 tty_insert_flip_string(tty, data,
510 available_room);
511 tty_flip_buffer_push(tty);
512 }
513 tty_kref_put(tty); 509 tty_kref_put(tty);
514 } 510 }
515 spin_lock(&priv->lock); 511 spin_lock(&priv->lock);