Remove disconnected test from close which did not protect any device IO
at all.

Signed-off-by: Johan Hovold <jhov...@gmail.com>
---
 drivers/usb/serial/cypress_m8.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 23b77eb..f6a7d88 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -636,12 +636,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);
@@ -653,7 +647,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 */
 
 
-- 
1.8.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to