--- usb-serial.c.old 2005-12-14 17:41:10.887045569 +0100 +++ usb-serial.c 2005-12-14 17:41:02.115759638 +0100 @@ -653,8 +653,13 @@ static int serial_ioctl (struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg) { - struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; - int retval = -ENODEV; + struct usb_serial_port *port; + int retval; + printk(KERN_DEBUG "serial_ioctl: tty=%08x\n",(unsigned long)tty); + port = (struct usb_serial_port *) tty->driver_data; + printk(KERN_DEBUG "serial_ioctl: port=%08x\n",(unsigned long)port); + retval = -ENODEV; + printk(KERN_DEBUG "serial_ioctl: port->open_count=%d\n",port->open_count); dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd);