]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] USB: console: prevent ENODEV on node
authorPaul Fulghum <paulkf@microgate.com>
Thu, 13 Apr 2006 20:28:17 +0000 (22:28 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 Jun 2006 22:04:09 +0000 (15:04 -0700)
Prevent ENODEV on a /dev/ttyUSBx, used as a USB-serial console.

From: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/usb-serial.c

index 9c36f0ece20ff6b43631e860621198f694400d5f..de9111d97a587013e251ddfba396607652bea6ef 100644 (file)
@@ -201,12 +201,12 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
         
        ++port->open_count;
 
-       if (port->open_count == 1) {
+       /* set up our port structure making the tty driver
+        * remember our port object, and us it */
+       tty->driver_data = port;
+       port->tty = tty;
 
-               /* set up our port structure making the tty driver
-                * remember our port object, and us it */
-               tty->driver_data = port;
-               port->tty = tty;
+       if (port->open_count == 1) {
 
                /* lock this module before we call it
                 * this may fail, which means we must bail out,