]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/usb/serial/digi_acceleport.c
Merge tag 'usb-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[karo-tx-linux.git] / drivers / usb / serial / digi_acceleport.c
index 31191581060c94762c7265eb031e224ccb227713..7b807d38952783b43854370590e0cc9db628ae49 100644 (file)
@@ -196,7 +196,6 @@ struct digi_port {
        unsigned char dp_out_buf[DIGI_OUT_BUF_SIZE];
        int dp_write_urb_in_use;
        unsigned int dp_modem_signals;
-       wait_queue_head_t dp_modem_change_wait;
        int dp_transmit_idle;
        wait_queue_head_t dp_transmit_idle_wait;
        int dp_throttled;
@@ -1138,53 +1137,51 @@ static void digi_close(struct usb_serial_port *port)
        if (port->serial->disconnected)
                goto exit;
 
-       if (port->serial->dev) {
-               /* FIXME: Transmit idle belongs in the wait_unti_sent path */
-               digi_transmit_idle(port, DIGI_CLOSE_TIMEOUT);
-
-               /* disable input flow control */
-               buf[0] = DIGI_CMD_SET_INPUT_FLOW_CONTROL;
-               buf[1] = priv->dp_port_num;
-               buf[2] = DIGI_DISABLE;
-               buf[3] = 0;
-
-               /* disable output flow control */
-               buf[4] = DIGI_CMD_SET_OUTPUT_FLOW_CONTROL;
-               buf[5] = priv->dp_port_num;
-               buf[6] = DIGI_DISABLE;
-               buf[7] = 0;
-
-               /* disable reading modem signals automatically */
-               buf[8] = DIGI_CMD_READ_INPUT_SIGNALS;
-               buf[9] = priv->dp_port_num;
-               buf[10] = DIGI_DISABLE;
-               buf[11] = 0;
-
-               /* disable receive */
-               buf[12] = DIGI_CMD_RECEIVE_ENABLE;
-               buf[13] = priv->dp_port_num;
-               buf[14] = DIGI_DISABLE;
-               buf[15] = 0;
-
-               /* flush fifos */
-               buf[16] = DIGI_CMD_IFLUSH_FIFO;
-               buf[17] = priv->dp_port_num;
-               buf[18] = DIGI_FLUSH_TX | DIGI_FLUSH_RX;
-               buf[19] = 0;
-
-               ret = digi_write_oob_command(port, buf, 20, 0);
-               if (ret != 0)
-                       dev_dbg(&port->dev, "digi_close: write oob failed, ret=%d\n", ret);
-
-               /* wait for final commands on oob port to complete */
-               prepare_to_wait(&priv->dp_flush_wait, &wait,
-                                                       TASK_INTERRUPTIBLE);
-               schedule_timeout(DIGI_CLOSE_TIMEOUT);
-               finish_wait(&priv->dp_flush_wait, &wait);
-
-               /* shutdown any outstanding bulk writes */
-               usb_kill_urb(port->write_urb);
-       }
+       /* FIXME: Transmit idle belongs in the wait_unti_sent path */
+       digi_transmit_idle(port, DIGI_CLOSE_TIMEOUT);
+
+       /* disable input flow control */
+       buf[0] = DIGI_CMD_SET_INPUT_FLOW_CONTROL;
+       buf[1] = priv->dp_port_num;
+       buf[2] = DIGI_DISABLE;
+       buf[3] = 0;
+
+       /* disable output flow control */
+       buf[4] = DIGI_CMD_SET_OUTPUT_FLOW_CONTROL;
+       buf[5] = priv->dp_port_num;
+       buf[6] = DIGI_DISABLE;
+       buf[7] = 0;
+
+       /* disable reading modem signals automatically */
+       buf[8] = DIGI_CMD_READ_INPUT_SIGNALS;
+       buf[9] = priv->dp_port_num;
+       buf[10] = DIGI_DISABLE;
+       buf[11] = 0;
+
+       /* disable receive */
+       buf[12] = DIGI_CMD_RECEIVE_ENABLE;
+       buf[13] = priv->dp_port_num;
+       buf[14] = DIGI_DISABLE;
+       buf[15] = 0;
+
+       /* flush fifos */
+       buf[16] = DIGI_CMD_IFLUSH_FIFO;
+       buf[17] = priv->dp_port_num;
+       buf[18] = DIGI_FLUSH_TX | DIGI_FLUSH_RX;
+       buf[19] = 0;
+
+       ret = digi_write_oob_command(port, buf, 20, 0);
+       if (ret != 0)
+               dev_dbg(&port->dev, "digi_close: write oob failed, ret=%d\n",
+                                                                       ret);
+       /* wait for final commands on oob port to complete */
+       prepare_to_wait(&priv->dp_flush_wait, &wait,
+                       TASK_INTERRUPTIBLE);
+       schedule_timeout(DIGI_CLOSE_TIMEOUT);
+       finish_wait(&priv->dp_flush_wait, &wait);
+
+       /* shutdown any outstanding bulk writes */
+       usb_kill_urb(port->write_urb);
 exit:
        spin_lock_irq(&priv->dp_port_lock);
        priv->dp_write_urb_in_use = 0;
@@ -1241,7 +1238,6 @@ static int digi_port_init(struct usb_serial_port *port, unsigned port_num)
 
        spin_lock_init(&priv->dp_port_lock);
        priv->dp_port_num = port_num;
-       init_waitqueue_head(&priv->dp_modem_change_wait);
        init_waitqueue_head(&priv->dp_transmit_idle_wait);
        init_waitqueue_head(&priv->dp_flush_wait);
        init_waitqueue_head(&priv->dp_close_wait);
@@ -1532,7 +1528,6 @@ static int digi_read_oob_callback(struct urb *urb)
                        else
                                priv->dp_modem_signals &= ~TIOCM_CD;
 
-                       wake_up_interruptible(&priv->dp_modem_change_wait);
                        spin_unlock(&priv->dp_port_lock);
                } else if (opcode == DIGI_CMD_TRANSMIT_IDLE) {
                        spin_lock(&priv->dp_port_lock);