TTY: switch tty_flip_buffer_push
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / usb / serial / generic.c
index 3780f6a501b392006c94ec9fca21b51048abfa7e..4c5c23f1cae5db8a5ff157cbe0277dfb4bc42e5d 100644 (file)
@@ -313,17 +313,12 @@ EXPORT_SYMBOL_GPL(usb_serial_generic_submit_read_urbs);
 void usb_serial_generic_process_read_urb(struct urb *urb)
 {
        struct usb_serial_port *port = urb->context;
-       struct tty_struct *tty;
        char *ch = (char *)urb->transfer_buffer;
        int i;
 
        if (!urb->actual_length)
                return;
 
-       tty = tty_port_tty_get(&port->port);
-       if (!tty)
-               return;
-
        /* The per character mucking around with sysrq path it too slow for
           stuff like 3G modems, so shortcircuit it in the 99.9999999% of cases
           where the USB serial is not a console anyway */
@@ -335,8 +330,7 @@ void usb_serial_generic_process_read_urb(struct urb *urb)
                                tty_insert_flip_char(&port->port, *ch, TTY_NORMAL);
                }
        }
-       tty_flip_buffer_push(tty);
-       tty_kref_put(tty);
+       tty_flip_buffer_push(&port->port);
 }
 EXPORT_SYMBOL_GPL(usb_serial_generic_process_read_urb);