From: Paul Fulghum Date: Thu, 13 Apr 2006 20:28:17 +0000 (+0200) Subject: [PATCH] USB: console: prevent ENODEV on node X-Git-Tag: v2.6.18-rc1~858^2~102 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=ca85485c1f482e6625f36aceb85eaaeff4b22d79;p=linux-2.6-omap-h63xx.git [PATCH] USB: console: prevent ENODEV on node Prevent ENODEV on a /dev/ttyUSBx, used as a USB-serial console. From: Paul Fulghum Signed-off-by: Guennadi Liakhovetski Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 9c36f0ece20..de9111d97a5 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -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,