diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-01-03 09:53:04 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-16 01:22:35 -0500 |
commit | 05c7cd39907184328f48d3e7899f9cdd653ad336 (patch) | |
tree | 9d1ed5c757426aa20b7eccd853faa6b519a4aa7b /drivers/usb/serial | |
parent | 92a19f9cec9a80ad93c06e115822deb729e2c6ad (diff) |
TTY: switch tty_insert_flip_string
Now, we start converting tty buffer functions to actually use
tty_port. This will allow us to get rid of the need of tty in many
call sites. Only tty_port will needed and hence no more
tty_port_tty_get in those paths.
tty_insert_flip_string this time.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
26 files changed, 55 insertions, 53 deletions
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c index 6d110a3bc7e7..3bb1f8f11fc8 100644 --- a/drivers/usb/serial/aircable.c +++ b/drivers/usb/serial/aircable.c | |||
@@ -119,9 +119,8 @@ static int aircable_probe(struct usb_serial *serial, | |||
119 | return 0; | 119 | return 0; |
120 | } | 120 | } |
121 | 121 | ||
122 | static int aircable_process_packet(struct tty_struct *tty, | 122 | static int aircable_process_packet(struct usb_serial_port *port, |
123 | struct usb_serial_port *port, int has_headers, | 123 | int has_headers, char *packet, int len) |
124 | char *packet, int len) | ||
125 | { | 124 | { |
126 | if (has_headers) { | 125 | if (has_headers) { |
127 | len -= HCI_HEADER_LENGTH; | 126 | len -= HCI_HEADER_LENGTH; |
@@ -132,7 +131,7 @@ static int aircable_process_packet(struct tty_struct *tty, | |||
132 | return 0; | 131 | return 0; |
133 | } | 132 | } |
134 | 133 | ||
135 | tty_insert_flip_string(tty, packet, len); | 134 | tty_insert_flip_string(&port->port, packet, len); |
136 | 135 | ||
137 | return len; | 136 | return len; |
138 | } | 137 | } |
@@ -156,7 +155,7 @@ static void aircable_process_read_urb(struct urb *urb) | |||
156 | count = 0; | 155 | count = 0; |
157 | for (i = 0; i < urb->actual_length; i += HCI_COMPLETE_FRAME) { | 156 | for (i = 0; i < urb->actual_length; i += HCI_COMPLETE_FRAME) { |
158 | len = min_t(int, urb->actual_length - i, HCI_COMPLETE_FRAME); | 157 | len = min_t(int, urb->actual_length - i, HCI_COMPLETE_FRAME); |
159 | count += aircable_process_packet(tty, port, has_headers, | 158 | count += aircable_process_packet(port, has_headers, |
160 | &data[i], len); | 159 | &data[i], len); |
161 | } | 160 | } |
162 | 161 | ||
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index 69a4fa1cee25..e6976a974472 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c | |||
@@ -343,7 +343,7 @@ static void cyberjack_read_bulk_callback(struct urb *urb) | |||
343 | return; | 343 | return; |
344 | } | 344 | } |
345 | if (urb->actual_length) { | 345 | if (urb->actual_length) { |
346 | tty_insert_flip_string(tty, data, urb->actual_length); | 346 | tty_insert_flip_string(&port->port, data, urb->actual_length); |
347 | tty_flip_buffer_push(tty); | 347 | tty_flip_buffer_push(tty); |
348 | } | 348 | } |
349 | tty_kref_put(tty); | 349 | tty_kref_put(tty); |
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index 203358d7e7bc..498b5f0da639 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c | |||
@@ -256,7 +256,7 @@ static void send_to_tty(struct usb_serial_port *port, | |||
256 | 256 | ||
257 | if (tty && actual_length) { | 257 | if (tty && actual_length) { |
258 | usb_serial_debug_data(&port->dev, __func__, actual_length, data); | 258 | usb_serial_debug_data(&port->dev, __func__, actual_length, data); |
259 | tty_insert_flip_string(tty, data, actual_length); | 259 | tty_insert_flip_string(&port->port, data, actual_length); |
260 | tty_flip_buffer_push(tty); | 260 | tty_flip_buffer_push(tty); |
261 | } | 261 | } |
262 | tty_kref_put(tty); | 262 | tty_kref_put(tty); |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index b00110cd5689..3780f6a501b3 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -328,7 +328,7 @@ void usb_serial_generic_process_read_urb(struct urb *urb) | |||
328 | stuff like 3G modems, so shortcircuit it in the 99.9999999% of cases | 328 | stuff like 3G modems, so shortcircuit it in the 99.9999999% of cases |
329 | where the USB serial is not a console anyway */ | 329 | where the USB serial is not a console anyway */ |
330 | if (!port->port.console || !port->sysrq) | 330 | if (!port->port.console || !port->sysrq) |
331 | tty_insert_flip_string(tty, ch, urb->actual_length); | 331 | tty_insert_flip_string(&port->port, ch, urb->actual_length); |
332 | else { | 332 | else { |
333 | for (i = 0; i < urb->actual_length; i++, ch++) { | 333 | for (i = 0; i < urb->actual_length; i++, ch++) { |
334 | if (!usb_serial_handle_sysrq_char(port, *ch)) | 334 | if (!usb_serial_handle_sysrq_char(port, *ch)) |
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 7b770c7f8b11..f96b91da964f 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c | |||
@@ -232,7 +232,7 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, | |||
232 | unsigned char *buffer, __u16 bufferLength); | 232 | unsigned char *buffer, __u16 bufferLength); |
233 | static void process_rcvd_status(struct edgeport_serial *edge_serial, | 233 | static void process_rcvd_status(struct edgeport_serial *edge_serial, |
234 | __u8 byte2, __u8 byte3); | 234 | __u8 byte2, __u8 byte3); |
235 | static void edge_tty_recv(struct device *dev, struct tty_struct *tty, | 235 | static void edge_tty_recv(struct usb_serial_port *port, struct tty_struct *tty, |
236 | unsigned char *data, int length); | 236 | unsigned char *data, int length); |
237 | static void handle_new_msr(struct edgeport_port *edge_port, __u8 newMsr); | 237 | static void handle_new_msr(struct edgeport_port *edge_port, __u8 newMsr); |
238 | static void handle_new_lsr(struct edgeport_port *edge_port, __u8 lsrData, | 238 | static void handle_new_lsr(struct edgeport_port *edge_port, __u8 lsrData, |
@@ -1865,7 +1865,7 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, | |||
1865 | if (tty) { | 1865 | if (tty) { |
1866 | dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n", | 1866 | dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n", |
1867 | __func__, rxLen, edge_serial->rxPort); | 1867 | __func__, rxLen, edge_serial->rxPort); |
1868 | edge_tty_recv(&edge_serial->serial->dev->dev, tty, buffer, rxLen); | 1868 | edge_tty_recv(edge_port->port, tty, buffer, rxLen); |
1869 | tty_kref_put(tty); | 1869 | tty_kref_put(tty); |
1870 | } | 1870 | } |
1871 | edge_port->icount.rx += rxLen; | 1871 | edge_port->icount.rx += rxLen; |
@@ -2017,14 +2017,14 @@ static void process_rcvd_status(struct edgeport_serial *edge_serial, | |||
2017 | * edge_tty_recv | 2017 | * edge_tty_recv |
2018 | * this function passes data on to the tty flip buffer | 2018 | * this function passes data on to the tty flip buffer |
2019 | *****************************************************************************/ | 2019 | *****************************************************************************/ |
2020 | static void edge_tty_recv(struct device *dev, struct tty_struct *tty, | 2020 | static void edge_tty_recv(struct usb_serial_port *port, struct tty_struct *tty, |
2021 | unsigned char *data, int length) | 2021 | unsigned char *data, int length) |
2022 | { | 2022 | { |
2023 | int cnt; | 2023 | int cnt; |
2024 | 2024 | ||
2025 | cnt = tty_insert_flip_string(tty, data, length); | 2025 | cnt = tty_insert_flip_string(&port->port, data, length); |
2026 | if (cnt < length) { | 2026 | if (cnt < length) { |
2027 | dev_err(dev, "%s - dropping data, %d bytes lost\n", | 2027 | dev_err(&port->dev, "%s - dropping data, %d bytes lost\n", |
2028 | __func__, length - cnt); | 2028 | __func__, length - cnt); |
2029 | } | 2029 | } |
2030 | data += cnt; | 2030 | data += cnt; |
@@ -2090,7 +2090,7 @@ static void handle_new_lsr(struct edgeport_port *edge_port, __u8 lsrData, | |||
2090 | struct tty_struct *tty = | 2090 | struct tty_struct *tty = |
2091 | tty_port_tty_get(&edge_port->port->port); | 2091 | tty_port_tty_get(&edge_port->port->port); |
2092 | if (tty) { | 2092 | if (tty) { |
2093 | edge_tty_recv(&edge_port->port->dev, tty, &data, 1); | 2093 | edge_tty_recv(edge_port->port, tty, &data, 1); |
2094 | tty_kref_put(tty); | 2094 | tty_kref_put(tty); |
2095 | } | 2095 | } |
2096 | } | 2096 | } |
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 58184f3de686..1286a0b2e2b7 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -201,7 +201,7 @@ static int closing_wait = EDGE_CLOSING_WAIT; | |||
201 | static bool ignore_cpu_rev; | 201 | static bool ignore_cpu_rev; |
202 | static int default_uart_mode; /* RS232 */ | 202 | static int default_uart_mode; /* RS232 */ |
203 | 203 | ||
204 | static void edge_tty_recv(struct device *dev, struct tty_struct *tty, | 204 | static void edge_tty_recv(struct usb_serial_port *port, struct tty_struct *tty, |
205 | unsigned char *data, int length); | 205 | unsigned char *data, int length); |
206 | 206 | ||
207 | static void stop_read(struct edgeport_port *edge_port); | 207 | static void stop_read(struct edgeport_port *edge_port); |
@@ -1557,7 +1557,7 @@ static void handle_new_lsr(struct edgeport_port *edge_port, int lsr_data, | |||
1557 | if (lsr_data) { | 1557 | if (lsr_data) { |
1558 | tty = tty_port_tty_get(&edge_port->port->port); | 1558 | tty = tty_port_tty_get(&edge_port->port->port); |
1559 | if (tty) { | 1559 | if (tty) { |
1560 | edge_tty_recv(&edge_port->port->dev, tty, &data, 1); | 1560 | edge_tty_recv(edge_port->port, tty, &data, 1); |
1561 | tty_kref_put(tty); | 1561 | tty_kref_put(tty); |
1562 | } | 1562 | } |
1563 | } | 1563 | } |
@@ -1722,7 +1722,8 @@ static void edge_bulk_in_callback(struct urb *urb) | |||
1722 | dev_dbg(dev, "%s - close pending, dropping data on the floor\n", | 1722 | dev_dbg(dev, "%s - close pending, dropping data on the floor\n", |
1723 | __func__); | 1723 | __func__); |
1724 | else | 1724 | else |
1725 | edge_tty_recv(dev, tty, data, urb->actual_length); | 1725 | edge_tty_recv(edge_port->port, tty, data, |
1726 | urb->actual_length); | ||
1726 | edge_port->icount.rx += urb->actual_length; | 1727 | edge_port->icount.rx += urb->actual_length; |
1727 | } | 1728 | } |
1728 | tty_kref_put(tty); | 1729 | tty_kref_put(tty); |
@@ -1740,14 +1741,14 @@ exit: | |||
1740 | dev_err(dev, "%s - usb_submit_urb failed with result %d\n", __func__, retval); | 1741 | dev_err(dev, "%s - usb_submit_urb failed with result %d\n", __func__, retval); |
1741 | } | 1742 | } |
1742 | 1743 | ||
1743 | static void edge_tty_recv(struct device *dev, struct tty_struct *tty, | 1744 | static void edge_tty_recv(struct usb_serial_port *port, struct tty_struct *tty, |
1744 | unsigned char *data, int length) | 1745 | unsigned char *data, int length) |
1745 | { | 1746 | { |
1746 | int queued; | 1747 | int queued; |
1747 | 1748 | ||
1748 | queued = tty_insert_flip_string(tty, data, length); | 1749 | queued = tty_insert_flip_string(&port->port, data, length); |
1749 | if (queued < length) | 1750 | if (queued < length) |
1750 | dev_err(dev, "%s - dropping data, %d bytes lost\n", | 1751 | dev_err(&port->dev, "%s - dropping data, %d bytes lost\n", |
1751 | __func__, length - queued); | 1752 | __func__, length - queued); |
1752 | tty_flip_buffer_push(tty); | 1753 | tty_flip_buffer_push(tty); |
1753 | } | 1754 | } |
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index e24e2d4f4c1b..171dae1f4a62 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c | |||
@@ -305,7 +305,7 @@ static void ir_process_read_urb(struct urb *urb) | |||
305 | tty = tty_port_tty_get(&port->port); | 305 | tty = tty_port_tty_get(&port->port); |
306 | if (!tty) | 306 | if (!tty) |
307 | return; | 307 | return; |
308 | tty_insert_flip_string(tty, data + 1, urb->actual_length - 1); | 308 | tty_insert_flip_string(&port->port, data + 1, urb->actual_length - 1); |
309 | tty_flip_buffer_push(tty); | 309 | tty_flip_buffer_push(tty); |
310 | tty_kref_put(tty); | 310 | tty_kref_put(tty); |
311 | } | 311 | } |
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index 1e1fbed65ef2..dd0d910730c7 100644 --- a/drivers/usb/serial/iuu_phoenix.c +++ b/drivers/usb/serial/iuu_phoenix.c | |||
@@ -596,7 +596,7 @@ static void read_buf_callback(struct urb *urb) | |||
596 | if (data == NULL) | 596 | if (data == NULL) |
597 | dev_dbg(&port->dev, "%s - data is NULL !!!\n", __func__); | 597 | dev_dbg(&port->dev, "%s - data is NULL !!!\n", __func__); |
598 | if (tty && urb->actual_length && data) { | 598 | if (tty && urb->actual_length && data) { |
599 | tty_insert_flip_string(tty, data, urb->actual_length); | 599 | tty_insert_flip_string(&port->port, data, urb->actual_length); |
600 | tty_flip_buffer_push(tty); | 600 | tty_flip_buffer_push(tty); |
601 | } | 601 | } |
602 | tty_kref_put(tty); | 602 | tty_kref_put(tty); |
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index a4f5caebda43..14a219ba4ee6 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -472,7 +472,8 @@ static void usa28_indat_callback(struct urb *urb) | |||
472 | 472 | ||
473 | tty = tty_port_tty_get(&port->port); | 473 | tty = tty_port_tty_get(&port->port); |
474 | if (tty && urb->actual_length) { | 474 | if (tty && urb->actual_length) { |
475 | tty_insert_flip_string(tty, data, urb->actual_length); | 475 | tty_insert_flip_string(&port->port, data, |
476 | urb->actual_length); | ||
476 | tty_flip_buffer_push(tty); | 477 | tty_flip_buffer_push(tty); |
477 | } | 478 | } |
478 | tty_kref_put(tty); | 479 | tty_kref_put(tty); |
@@ -688,7 +689,7 @@ static void usa49_indat_callback(struct urb *urb) | |||
688 | /* 0x80 bit is error flag */ | 689 | /* 0x80 bit is error flag */ |
689 | if ((data[0] & 0x80) == 0) { | 690 | if ((data[0] & 0x80) == 0) { |
690 | /* no error on any byte */ | 691 | /* no error on any byte */ |
691 | tty_insert_flip_string(tty, data + 1, | 692 | tty_insert_flip_string(&port->port, data + 1, |
692 | urb->actual_length - 1); | 693 | urb->actual_length - 1); |
693 | } else { | 694 | } else { |
694 | /* some bytes had errors, every byte has status */ | 695 | /* some bytes had errors, every byte has status */ |
@@ -816,7 +817,8 @@ static void usa90_indat_callback(struct urb *urb) | |||
816 | otherwise looks like usa26 data format */ | 817 | otherwise looks like usa26 data format */ |
817 | 818 | ||
818 | if (p_priv->baud > 57600) | 819 | if (p_priv->baud > 57600) |
819 | tty_insert_flip_string(tty, data, urb->actual_length); | 820 | tty_insert_flip_string(&port->port, data, |
821 | urb->actual_length); | ||
820 | else { | 822 | else { |
821 | /* 0x80 bit is error flag */ | 823 | /* 0x80 bit is error flag */ |
822 | if ((data[0] & 0x80) == 0) { | 824 | if ((data[0] & 0x80) == 0) { |
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index 41b01092af07..334b1a295c6b 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c | |||
@@ -166,7 +166,7 @@ static void keyspan_pda_rx_interrupt(struct urb *urb) | |||
166 | tty = tty_port_tty_get(&port->port); | 166 | tty = tty_port_tty_get(&port->port); |
167 | /* rest of message is rx data */ | 167 | /* rest of message is rx data */ |
168 | if (tty && urb->actual_length) { | 168 | if (tty && urb->actual_length) { |
169 | tty_insert_flip_string(tty, data + 1, | 169 | tty_insert_flip_string(&port->port, data + 1, |
170 | urb->actual_length - 1); | 170 | urb->actual_length - 1); |
171 | tty_flip_buffer_push(tty); | 171 | tty_flip_buffer_push(tty); |
172 | } | 172 | } |
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c index fc9e14a1e9b3..8ee0825ad700 100644 --- a/drivers/usb/serial/kl5kusb105.c +++ b/drivers/usb/serial/kl5kusb105.c | |||
@@ -411,7 +411,7 @@ static void klsi_105_process_read_urb(struct urb *urb) | |||
411 | len = urb->actual_length - KLSI_HDR_LEN; | 411 | len = urb->actual_length - KLSI_HDR_LEN; |
412 | } | 412 | } |
413 | 413 | ||
414 | tty_insert_flip_string(tty, data + KLSI_HDR_LEN, len); | 414 | tty_insert_flip_string(&port->port, data + KLSI_HDR_LEN, len); |
415 | tty_flip_buffer_push(tty); | 415 | tty_flip_buffer_push(tty); |
416 | tty_kref_put(tty); | 416 | tty_kref_put(tty); |
417 | } | 417 | } |
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index b747ba615d0b..135c8b4b26f7 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c | |||
@@ -353,7 +353,7 @@ static void kobil_read_int_callback(struct urb *urb) | |||
353 | */ | 353 | */ |
354 | /* END DEBUG */ | 354 | /* END DEBUG */ |
355 | 355 | ||
356 | tty_insert_flip_string(tty, data, urb->actual_length); | 356 | tty_insert_flip_string(&port->port, data, urb->actual_length); |
357 | tty_flip_buffer_push(tty); | 357 | tty_flip_buffer_push(tty); |
358 | } | 358 | } |
359 | tty_kref_put(tty); | 359 | tty_kref_put(tty); |
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index b6911757c855..ba20bb037b28 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -563,7 +563,7 @@ static void mct_u232_read_int_callback(struct urb *urb) | |||
563 | if (urb->actual_length) { | 563 | if (urb->actual_length) { |
564 | tty = tty_port_tty_get(&port->port); | 564 | tty = tty_port_tty_get(&port->port); |
565 | if (tty) { | 565 | if (tty) { |
566 | tty_insert_flip_string(tty, data, | 566 | tty_insert_flip_string(&port->port, data, |
567 | urb->actual_length); | 567 | urb->actual_length); |
568 | tty_flip_buffer_push(tty); | 568 | tty_flip_buffer_push(tty); |
569 | } | 569 | } |
diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c index 3d258448c29a..6264f3974ea7 100644 --- a/drivers/usb/serial/metro-usb.c +++ b/drivers/usb/serial/metro-usb.c | |||
@@ -127,7 +127,7 @@ static void metrousb_read_int_callback(struct urb *urb) | |||
127 | tty = tty_port_tty_get(&port->port); | 127 | tty = tty_port_tty_get(&port->port); |
128 | if (tty && urb->actual_length) { | 128 | if (tty && urb->actual_length) { |
129 | /* Loop through the data copying each byte to the tty layer. */ | 129 | /* Loop through the data copying each byte to the tty layer. */ |
130 | tty_insert_flip_string(tty, data, urb->actual_length); | 130 | tty_insert_flip_string(&port->port, data, urb->actual_length); |
131 | 131 | ||
132 | /* Force the data to the tty layer. */ | 132 | /* Force the data to the tty layer. */ |
133 | tty_flip_buffer_push(tty); | 133 | tty_flip_buffer_push(tty); |
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index f57a6b1fe787..22818fb765e0 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -915,7 +915,7 @@ static void mos7720_bulk_in_callback(struct urb *urb) | |||
915 | 915 | ||
916 | tty = tty_port_tty_get(&port->port); | 916 | tty = tty_port_tty_get(&port->port); |
917 | if (tty && urb->actual_length) { | 917 | if (tty && urb->actual_length) { |
918 | tty_insert_flip_string(tty, data, urb->actual_length); | 918 | tty_insert_flip_string(&port->port, data, urb->actual_length); |
919 | tty_flip_buffer_push(tty); | 919 | tty_flip_buffer_push(tty); |
920 | } | 920 | } |
921 | tty_kref_put(tty); | 921 | tty_kref_put(tty); |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 66d9e088d9d9..3ddd7a1f7ff3 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -773,9 +773,10 @@ static void mos7840_bulk_in_callback(struct urb *urb) | |||
773 | usb_serial_debug_data(&port->dev, __func__, urb->actual_length, data); | 773 | usb_serial_debug_data(&port->dev, __func__, urb->actual_length, data); |
774 | 774 | ||
775 | if (urb->actual_length) { | 775 | if (urb->actual_length) { |
776 | tty = tty_port_tty_get(&mos7840_port->port->port); | 776 | struct tty_port *tport = &mos7840_port->port->port; |
777 | tty = tty_port_tty_get(tport); | ||
777 | if (tty) { | 778 | if (tty) { |
778 | tty_insert_flip_string(tty, data, urb->actual_length); | 779 | tty_insert_flip_string(tport, data, urb->actual_length); |
779 | tty_flip_buffer_push(tty); | 780 | tty_flip_buffer_push(tty); |
780 | tty_kref_put(tty); | 781 | tty_kref_put(tty); |
781 | } | 782 | } |
diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c index 1566f8f500ae..0d96a1a7b9e5 100644 --- a/drivers/usb/serial/navman.c +++ b/drivers/usb/serial/navman.c | |||
@@ -57,7 +57,7 @@ static void navman_read_int_callback(struct urb *urb) | |||
57 | 57 | ||
58 | tty = tty_port_tty_get(&port->port); | 58 | tty = tty_port_tty_get(&port->port); |
59 | if (tty && urb->actual_length) { | 59 | if (tty && urb->actual_length) { |
60 | tty_insert_flip_string(tty, data, urb->actual_length); | 60 | tty_insert_flip_string(&port->port, data, urb->actual_length); |
61 | tty_flip_buffer_push(tty); | 61 | tty_flip_buffer_push(tty); |
62 | } | 62 | } |
63 | tty_kref_put(tty); | 63 | tty_kref_put(tty); |
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index 7818af931a48..338191bae5a3 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c | |||
@@ -176,8 +176,9 @@ static void omninet_read_bulk_callback(struct urb *urb) | |||
176 | if (urb->actual_length && header->oh_len) { | 176 | if (urb->actual_length && header->oh_len) { |
177 | struct tty_struct *tty = tty_port_tty_get(&port->port); | 177 | struct tty_struct *tty = tty_port_tty_get(&port->port); |
178 | if (tty) { | 178 | if (tty) { |
179 | tty_insert_flip_string(tty, data + OMNINET_DATAOFFSET, | 179 | tty_insert_flip_string(&port->port, |
180 | header->oh_len); | 180 | data + OMNINET_DATAOFFSET, |
181 | header->oh_len); | ||
181 | tty_flip_buffer_push(tty); | 182 | tty_flip_buffer_push(tty); |
182 | tty_kref_put(tty); | 183 | tty_kref_put(tty); |
183 | } | 184 | } |
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index c6bfb83efb1e..d3b74e50aff1 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c | |||
@@ -57,7 +57,7 @@ static void opticon_process_data_packet(struct usb_serial_port *port, | |||
57 | if (!tty) | 57 | if (!tty) |
58 | return; | 58 | return; |
59 | 59 | ||
60 | tty_insert_flip_string(tty, buf, len); | 60 | tty_insert_flip_string(&port->port, buf, len); |
61 | tty_flip_buffer_push(tty); | 61 | tty_flip_buffer_push(tty); |
62 | tty_kref_put(tty); | 62 | tty_kref_put(tty); |
63 | } | 63 | } |
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index d217fd6ee43f..7a53fe9f3af3 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c | |||
@@ -837,7 +837,7 @@ static void oti6858_read_bulk_callback(struct urb *urb) | |||
837 | 837 | ||
838 | tty = tty_port_tty_get(&port->port); | 838 | tty = tty_port_tty_get(&port->port); |
839 | if (tty != NULL && urb->actual_length > 0) { | 839 | if (tty != NULL && urb->actual_length > 0) { |
840 | tty_insert_flip_string(tty, data, urb->actual_length); | 840 | tty_insert_flip_string(&port->port, data, urb->actual_length); |
841 | tty_flip_buffer_push(tty); | 841 | tty_flip_buffer_push(tty); |
842 | } | 842 | } |
843 | tty_kref_put(tty); | 843 | tty_kref_put(tty); |
diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c index 1e67fd89e346..5dccc4f957df 100644 --- a/drivers/usb/serial/quatech2.c +++ b/drivers/usb/serial/quatech2.c | |||
@@ -698,7 +698,7 @@ void qt2_process_read_urb(struct urb *urb) | |||
698 | break; | 698 | break; |
699 | case QT2_CONTROL_ESCAPE: | 699 | case QT2_CONTROL_ESCAPE: |
700 | tty_buffer_request_room(&port->port, 2); | 700 | tty_buffer_request_room(&port->port, 2); |
701 | tty_insert_flip_string(tty, ch, 2); | 701 | tty_insert_flip_string(&port->port, ch, 2); |
702 | i += 2; | 702 | i += 2; |
703 | escapeflag = true; | 703 | escapeflag = true; |
704 | break; | 704 | break; |
@@ -712,10 +712,8 @@ void qt2_process_read_urb(struct urb *urb) | |||
712 | continue; | 712 | continue; |
713 | } | 713 | } |
714 | 714 | ||
715 | if (tty) { | 715 | tty_buffer_request_room(&port->port, 1); |
716 | tty_buffer_request_room(&port->port, 1); | 716 | tty_insert_flip_string(&port->port, ch, 1); |
717 | tty_insert_flip_string(tty, ch, 1); | ||
718 | } | ||
719 | } | 717 | } |
720 | 718 | ||
721 | if (tty) { | 719 | if (tty) { |
diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c index c949ce6ef0c6..ad12e9e2c7ee 100644 --- a/drivers/usb/serial/safe_serial.c +++ b/drivers/usb/serial/safe_serial.c | |||
@@ -235,7 +235,7 @@ static void safe_process_read_urb(struct urb *urb) | |||
235 | dev_info(&urb->dev->dev, "%s - actual: %d\n", __func__, actual_length); | 235 | dev_info(&urb->dev->dev, "%s - actual: %d\n", __func__, actual_length); |
236 | length = actual_length; | 236 | length = actual_length; |
237 | out: | 237 | out: |
238 | tty_insert_flip_string(tty, data, length); | 238 | tty_insert_flip_string(&port->port, data, length); |
239 | tty_flip_buffer_push(tty); | 239 | tty_flip_buffer_push(tty); |
240 | err: | 240 | err: |
241 | tty_kref_put(tty); | 241 | tty_kref_put(tty); |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index af06f2f5f38b..64e53fda149b 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -583,7 +583,7 @@ static void sierra_indat_callback(struct urb *urb) | |||
583 | if (urb->actual_length) { | 583 | if (urb->actual_length) { |
584 | tty = tty_port_tty_get(&port->port); | 584 | tty = tty_port_tty_get(&port->port); |
585 | if (tty) { | 585 | if (tty) { |
586 | tty_insert_flip_string(tty, data, | 586 | tty_insert_flip_string(&port->port, data, |
587 | urb->actual_length); | 587 | urb->actual_length); |
588 | tty_flip_buffer_push(tty); | 588 | tty_flip_buffer_push(tty); |
589 | 589 | ||
diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c index 701fffa8431f..2ffa6ae3b5ed 100644 --- a/drivers/usb/serial/symbolserial.c +++ b/drivers/usb/serial/symbolserial.c | |||
@@ -84,7 +84,8 @@ static void symbol_int_callback(struct urb *urb) | |||
84 | */ | 84 | */ |
85 | tty = tty_port_tty_get(&port->port); | 85 | tty = tty_port_tty_get(&port->port); |
86 | if (tty) { | 86 | if (tty) { |
87 | tty_insert_flip_string(tty, &data[1], data_length); | 87 | tty_insert_flip_string(&port->port, &data[1], |
88 | data_length); | ||
88 | tty_flip_buffer_push(tty); | 89 | tty_flip_buffer_push(tty); |
89 | tty_kref_put(tty); | 90 | tty_kref_put(tty); |
90 | } | 91 | } |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index f2530d2ef3c4..05077e3c7631 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -121,7 +121,7 @@ static void ti_interrupt_callback(struct urb *urb); | |||
121 | static void ti_bulk_in_callback(struct urb *urb); | 121 | static void ti_bulk_in_callback(struct urb *urb); |
122 | static void ti_bulk_out_callback(struct urb *urb); | 122 | static void ti_bulk_out_callback(struct urb *urb); |
123 | 123 | ||
124 | static void ti_recv(struct device *dev, struct tty_struct *tty, | 124 | static void ti_recv(struct usb_serial_port *port, struct tty_struct *tty, |
125 | unsigned char *data, int length); | 125 | unsigned char *data, int length); |
126 | static void ti_send(struct ti_port *tport); | 126 | static void ti_send(struct ti_port *tport); |
127 | static int ti_set_mcr(struct ti_port *tport, unsigned int mcr); | 127 | static int ti_set_mcr(struct ti_port *tport, unsigned int mcr); |
@@ -1155,8 +1155,7 @@ static void ti_bulk_in_callback(struct urb *urb) | |||
1155 | dev_dbg(dev, "%s - port closed, dropping data\n", | 1155 | dev_dbg(dev, "%s - port closed, dropping data\n", |
1156 | __func__); | 1156 | __func__); |
1157 | else | 1157 | else |
1158 | ti_recv(&urb->dev->dev, tty, | 1158 | ti_recv(port, tty, urb->transfer_buffer, |
1159 | urb->transfer_buffer, | ||
1160 | urb->actual_length); | 1159 | urb->actual_length); |
1161 | spin_lock(&tport->tp_lock); | 1160 | spin_lock(&tport->tp_lock); |
1162 | tport->tp_icount.rx += urb->actual_length; | 1161 | tport->tp_icount.rx += urb->actual_length; |
@@ -1210,15 +1209,15 @@ static void ti_bulk_out_callback(struct urb *urb) | |||
1210 | } | 1209 | } |
1211 | 1210 | ||
1212 | 1211 | ||
1213 | static void ti_recv(struct device *dev, struct tty_struct *tty, | 1212 | static void ti_recv(struct usb_serial_port *port, struct tty_struct *tty, |
1214 | unsigned char *data, int length) | 1213 | unsigned char *data, int length) |
1215 | { | 1214 | { |
1216 | int cnt; | 1215 | int cnt; |
1217 | 1216 | ||
1218 | do { | 1217 | do { |
1219 | cnt = tty_insert_flip_string(tty, data, length); | 1218 | cnt = tty_insert_flip_string(&port->port, data, length); |
1220 | if (cnt < length) { | 1219 | if (cnt < length) { |
1221 | dev_err(dev, "%s - dropping data, %d bytes lost\n", | 1220 | dev_err(&port->dev, "%s - dropping data, %d bytes lost\n", |
1222 | __func__, length - cnt); | 1221 | __func__, length - cnt); |
1223 | if (cnt == 0) | 1222 | if (cnt == 0) |
1224 | break; | 1223 | break; |
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 01c94aada56c..293b460030cb 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c | |||
@@ -291,7 +291,7 @@ static void usb_wwan_indat_callback(struct urb *urb) | |||
291 | tty = tty_port_tty_get(&port->port); | 291 | tty = tty_port_tty_get(&port->port); |
292 | if (tty) { | 292 | if (tty) { |
293 | if (urb->actual_length) { | 293 | if (urb->actual_length) { |
294 | tty_insert_flip_string(tty, data, | 294 | tty_insert_flip_string(&port->port, data, |
295 | urb->actual_length); | 295 | urb->actual_length); |
296 | tty_flip_buffer_push(tty); | 296 | tty_flip_buffer_push(tty); |
297 | } else | 297 | } else |