Merge tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwm
[firefly-linux-kernel-4.4.55.git] / drivers / usb / serial / digi_acceleport.c
index b5fa738512ca785559ecff49c8238949fb52f688..ebe45fa0ed50a3722ed7feae0750558ffea7fdad 100644 (file)
@@ -1399,9 +1399,7 @@ static void digi_read_bulk_callback(struct urb *urb)
 
 static int digi_read_inb_callback(struct urb *urb)
 {
-
        struct usb_serial_port *port = urb->context;
-       struct tty_struct *tty;
        struct digi_port *priv = usb_get_serial_port_data(port);
        int opcode = ((unsigned char *)urb->transfer_buffer)[0];
        int len = ((unsigned char *)urb->transfer_buffer)[1];
@@ -1425,7 +1423,6 @@ static int digi_read_inb_callback(struct urb *urb)
                return -1;
        }
 
-       tty = tty_port_tty_get(&port->port);
        spin_lock(&priv->dp_port_lock);
 
        /* check for throttle; if set, do not resubmit read urb */
@@ -1435,7 +1432,7 @@ static int digi_read_inb_callback(struct urb *urb)
                priv->dp_throttle_restart = 1;
 
        /* receive data */
-       if (tty && opcode == DIGI_CMD_RECEIVE_DATA) {
+       if (opcode == DIGI_CMD_RECEIVE_DATA) {
                /* get flag from port_status */
                flag = 0;
 
@@ -1457,11 +1454,10 @@ static int digi_read_inb_callback(struct urb *urb)
                if (len > 0) {
                        tty_insert_flip_string_fixed_flag(&port->port, data,
                                        flag, len);
-                       tty_flip_buffer_push(tty);
+                       tty_flip_buffer_push(&port->port);
                }
        }
        spin_unlock(&priv->dp_port_lock);
-       tty_kref_put(tty);
 
        if (opcode == DIGI_CMD_RECEIVE_DISABLE)
                dev_dbg(&port->dev, "%s: got RECEIVE_DISABLE\n", __func__);