diff options
Diffstat (limited to 'drivers/usb/serial/generic.c')
-rw-r--r-- | drivers/usb/serial/generic.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 2ea70a631996..4c5c23f1cae5 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -313,30 +313,24 @@ EXPORT_SYMBOL_GPL(usb_serial_generic_submit_read_urbs); | |||
313 | void usb_serial_generic_process_read_urb(struct urb *urb) | 313 | void usb_serial_generic_process_read_urb(struct urb *urb) |
314 | { | 314 | { |
315 | struct usb_serial_port *port = urb->context; | 315 | struct usb_serial_port *port = urb->context; |
316 | struct tty_struct *tty; | ||
317 | char *ch = (char *)urb->transfer_buffer; | 316 | char *ch = (char *)urb->transfer_buffer; |
318 | int i; | 317 | int i; |
319 | 318 | ||
320 | if (!urb->actual_length) | 319 | if (!urb->actual_length) |
321 | return; | 320 | return; |
322 | 321 | ||
323 | tty = tty_port_tty_get(&port->port); | ||
324 | if (!tty) | ||
325 | return; | ||
326 | |||
327 | /* The per character mucking around with sysrq path it too slow for | 322 | /* The per character mucking around with sysrq path it too slow for |
328 | stuff like 3G modems, so shortcircuit it in the 99.9999999% of cases | 323 | stuff like 3G modems, so shortcircuit it in the 99.9999999% of cases |
329 | where the USB serial is not a console anyway */ | 324 | where the USB serial is not a console anyway */ |
330 | if (!port->port.console || !port->sysrq) | 325 | if (!port->port.console || !port->sysrq) |
331 | tty_insert_flip_string(tty, ch, urb->actual_length); | 326 | tty_insert_flip_string(&port->port, ch, urb->actual_length); |
332 | else { | 327 | else { |
333 | for (i = 0; i < urb->actual_length; i++, ch++) { | 328 | for (i = 0; i < urb->actual_length; i++, ch++) { |
334 | if (!usb_serial_handle_sysrq_char(port, *ch)) | 329 | if (!usb_serial_handle_sysrq_char(port, *ch)) |
335 | tty_insert_flip_char(tty, *ch, TTY_NORMAL); | 330 | tty_insert_flip_char(&port->port, *ch, TTY_NORMAL); |
336 | } | 331 | } |
337 | } | 332 | } |
338 | tty_flip_buffer_push(tty); | 333 | tty_flip_buffer_push(&port->port); |
339 | tty_kref_put(tty); | ||
340 | } | 334 | } |
341 | EXPORT_SYMBOL_GPL(usb_serial_generic_process_read_urb); | 335 | EXPORT_SYMBOL_GPL(usb_serial_generic_process_read_urb); |
342 | 336 | ||