]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
USB: cypress_m8: remove bogus disconnect test from close
authorJohan Hovold <jhovold@gmail.com>
Thu, 21 Mar 2013 11:37:37 +0000 (12:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 20:54:30 +0000 (13:54 -0700)
Remove disconnected test from close which did not protect any device IO
at all.

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

index e4a62cfc4081a5783205cf7dc3743a9e1da5caeb..d341555d37d8bbe85f719d782049806522d2a066 100644 (file)
@@ -632,12 +632,6 @@ static void cypress_close(struct usb_serial_port *port)
        struct cypress_private *priv = usb_get_serial_port_data(port);
        unsigned long flags;
 
-       /* writing is potentially harmful, lock must be taken */
-       mutex_lock(&port->serial->disc_mutex);
-       if (port->serial->disconnected) {
-               mutex_unlock(&port->serial->disc_mutex);
-               return;
-       }
        spin_lock_irqsave(&priv->lock, flags);
        kfifo_reset_out(&priv->write_fifo);
        spin_unlock_irqrestore(&priv->lock, flags);
@@ -649,7 +643,6 @@ static void cypress_close(struct usb_serial_port *port)
        if (stats)
                dev_info(&port->dev, "Statistics: %d Bytes In | %d Bytes Out | %d Commands Issued\n",
                        priv->bytes_in, priv->bytes_out, priv->cmd_count);
-       mutex_unlock(&port->serial->disc_mutex);
 } /* cypress_close */