USB: io_ti: always disable uart on close
authorJohan Hovold <jhovold@gmail.com>
Thu, 21 Mar 2013 11:37:38 +0000 (12:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 20:54:31 +0000 (13:54 -0700)
Always try to disable the uart on close.

Since the switch to tty ports, close will be called as part of shutdown
before disconnect returns. Hence there is no need to check the
disconnected flag, and we can put devices in disabled states also on
driver unbind.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/io_ti.c

index 8914002..0ccc422 100644 (file)
@@ -1907,21 +1907,10 @@ static void edge_close(struct usb_serial_port *port)
        kfifo_reset_out(&edge_port->write_fifo);
        spin_unlock_irqrestore(&edge_port->ep_lock, flags);
 
-       /* assuming we can still talk to the device,
-        * send a close port command to it */
        dev_dbg(&port->dev, "%s - send umpc_close_port\n", __func__);
        port_number = port->number - port->serial->minor;
-
-       mutex_lock(&serial->disc_mutex);
-       if (!serial->disconnected) {
-               send_cmd(serial->dev,
-                                    UMPC_CLOSE_PORT,
-                                    (__u8)(UMPM_UART1_PORT + port_number),
-                                    0,
-                                    NULL,
-                                    0);
-       }
-       mutex_unlock(&serial->disc_mutex);
+       send_cmd(serial->dev, UMPC_CLOSE_PORT,
+                    (__u8)(UMPM_UART1_PORT + port_number), 0, NULL, 0);
 
        mutex_lock(&edge_serial->es_lock);
        --edge_port->edge_serial->num_ports_open;