From g.liakhovetski@gmx.de Thu Apr 13 13:28:18 2006 Date: Thu, 13 Apr 2006 22:28:17 +0200 (CEST) From: Guennadi Liakhovetski To: Greg KH Cc: Paul Fulghum Subject: USB: console: prevent ENODEV on node Message-ID: From: Paul Fulghum 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 --- drivers/usb/serial/usb-serial.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- gregkh-2.6.orig/drivers/usb/serial/usb-serial.c +++ gregkh-2.6/drivers/usb/serial/usb-serial.c @@ -201,12 +201,12 @@ static int serial_open (struct tty_struc ++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,