Skip to contentSkip to conversation

use tty_driver.name as default .devfs_name

PATCH New Roman Kagan 1 participant 1 message Jun 15, 2003 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 use tty_driver.name as default .devfs_name

Hi,

In 2.5.71 with devfs enabled my USB modem appears as /dev/<NULL>0 instead of the usual /dev/usb/acm/0. I tracked down this problem to be due to

[email protected] 2003-06-06 08:54:35-07:00 [email protected]

(originally "[PATCH] Fix tty devfs mess" from Christoph Hellwig <[email protected]>)

where a new .devfs_name field was introduced in struct tty_driver. However, many drivers (including cdc-acm) haven't been updated to define it. OTOH they seem to be quite happy using their .name for devfs as well. This patch makes .name the default .devfs_name. Since tty_{,un}register_device() appear to be the only users of .devfs_name, there should be no side effects. WFM. Please consider applying.

Roman.

drivers/char/tty_io.c renamed from drivers/char/tty_io.c~ +4 -0
@@ -2183,6 +2183,10 @@
 		return;
 	}
 
+	/* Use driver name for devfs as well */
+	if (!driver->devfs_name)
+		driver->devfs_name = driver->name;
+
 	devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR,
 			"%s%d", driver->devfs_name, index + driver->name_base);