]> Pileus Git - ~andy/linux/commitdiff
USB: pl2303: remove disconnect test from tiocmset
authorJohan Hovold <jhovold@gmail.com>
Thu, 21 Mar 2013 11:37:45 +0000 (12:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 20:54:32 +0000 (13:54 -0700)
Remove unnecessary disconnect test in tiocmset. No ioctls will be made
after disconnect returns.

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

index 4dff17902fa04990f3bdb7d00c904cea5974cdd6..7151659367a0898cec3124e8ee328bf17f57d6bd 100644 (file)
@@ -531,7 +531,6 @@ static int pl2303_tiocmset(struct tty_struct *tty,
                           unsigned int set, unsigned int clear)
 {
        struct usb_serial_port *port = tty->driver_data;
-       struct usb_serial *serial = port->serial;
        struct pl2303_private *priv = usb_get_serial_port_data(port);
        unsigned long flags;
        u8 control;
@@ -549,17 +548,11 @@ static int pl2303_tiocmset(struct tty_struct *tty,
        control = priv->line_control;
        spin_unlock_irqrestore(&priv->lock, flags);
 
-       mutex_lock(&serial->disc_mutex);
-       if (!serial->disconnected) {
-               ret = pl2303_set_control_lines(port, control);
-               if (ret)
-                       ret = usb_translate_errors(ret);
-       } else {
-               ret = -ENODEV;
-       }
-       mutex_unlock(&serial->disc_mutex);
+       ret = pl2303_set_control_lines(port, control);
+       if (ret)
+               return usb_translate_errors(ret);
 
-       return ret;
+       return 0;
 }
 
 static int pl2303_tiocmget(struct tty_struct *tty)