]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: cp210x: call generic open last in open
authorJohan Hovold <jhovold@gmail.com>
Sun, 15 Jan 2012 23:36:48 +0000 (00:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Feb 2012 17:19:05 +0000 (09:19 -0800)
commit 55b2afbb92ad92e9f6b0aa4354eb1c94589280c3 upstream.

Make sure port is fully initialised before calling generic open.

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

index 3b43d9b6668f1d4ff581bcf02beb21669fae45fa..cbcaddb1bf4c50f92ef3337e0ca6cbb4aad62999 100644 (file)
@@ -393,8 +393,6 @@ static unsigned int cp210x_quantise_baudrate(unsigned int baud) {
 
 static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
 {
-       int result;
-
        dbg("%s - port %d", __func__, port->number);
 
        if (cp210x_set_config_single(port, CP210X_IFC_ENABLE, UART_ENABLE)) {
@@ -403,13 +401,10 @@ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
                return -EPROTO;
        }
 
-       result = usb_serial_generic_open(tty, port);
-       if (result)
-               return result;
-
        /* Configure the termios structure */
        cp210x_get_termios(tty, port);
-       return 0;
+
+       return usb_serial_generic_open(tty, port);
 }
 
 static void cp210x_close(struct usb_serial_port *port)