Devfs, tty subsystem, and usb-serial driver problem

From: Greg KH (
Date: Thu Apr 27 2000 - 01:44:37 EST

Hi all,

I've been working at getting the usb-serial drivers to work properly
with devfs and have run into a few questions.

Currently the usb-serial driver registers itself with the tty subsystem
with tty_register_driver ONLY when a usb-serial device is attached to
the usb bus. tty_register_driver calls devfs_register_chrdev, passing it
the drivers major, name, and the tty layer file functions. Since the
major, minor_start, and num elements are set properly in the struct
tty_driver, this works just fine when devfs is not used.

The name I am giving the usb-serial driver is: "usb/tty/%d"

The problem sequence is this:
  1) a 4 port usb to serial device is plugged in to the system.
     tty_register driver is called which causes devfs to create the nodes
     /dev/usb/tty/0 - /dev/usb/tty/3 which work wonderfully.

  2) a 2 port usb to serial device (like a HandSpring Visor) is then plugged
     into the system. devfs chokes on this and reports the following:
devfs: devfs_register(): device already registered: "usb/tty/0"
devfs: devfs_register(): device already registered: "usb/tty/1"
     and there are no nodes created that I can use to access this new

It looks like devfs does not know that it had already registered 4 nodes
before this.

Is there anything that I can change in the usb-serial code to get this
to work properly (different name string, calling devfs_register_*
directly, etc)?

Someone suggested that I change the device name to be
"usb/tty[minor]/%d" and replace [minor] with the specific minor for that
device and then register each minor separately (so for a 4 port device,
the driver would call tty_register 4 times.) This seems to be too much
of a hack, as it then creates /dev/usb/tty0/0 - /dev/usb/tty3/0 for the
4 port device example.

Any help would be appreciated.


greg k-h

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:12 EST