Merge tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwm
[firefly-linux-kernel-4.4.55.git] / drivers / usb / serial / metro-usb.c
index 3d258448c29af70e03fbbe91f8215a7e988b8aae..bf3c7a23553efbe73d1c12b4e7b910d506fed474 100644 (file)
@@ -95,7 +95,6 @@ static void metrousb_read_int_callback(struct urb *urb)
 {
        struct usb_serial_port *port = urb->context;
        struct metrousb_private *metro_priv = usb_get_serial_port_data(port);
-       struct tty_struct *tty;
        unsigned char *data = urb->transfer_buffer;
        int throttled = 0;
        int result = 0;
@@ -124,15 +123,13 @@ static void metrousb_read_int_callback(struct urb *urb)
 
 
        /* Set the data read from the usb port into the serial port buffer. */
-       tty = tty_port_tty_get(&port->port);
-       if (tty && urb->actual_length) {
+       if (urb->actual_length) {
                /* Loop through the data copying each byte to the tty layer. */
-               tty_insert_flip_string(tty, data, urb->actual_length);
+               tty_insert_flip_string(&port->port, data, urb->actual_length);
 
                /* Force the data to the tty layer. */
-               tty_flip_buffer_push(tty);
+               tty_flip_buffer_push(&port->port);
        }
-       tty_kref_put(tty);
 
        /* Set any port variables. */
        spin_lock_irqsave(&metro_priv->lock, flags);