mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tty_io: Do not register NULL /dev entries on devfs
@ 2004-02-27 21:36 Marcelo Tosatti
  2004-02-27 20:48 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Marcelo Tosatti @ 2004-02-27 21:36 UTC (permalink / raw)
  To: torvalds; +Cc: Russell King, linux-kernel


Hi,

Faced this problem where "/dev/<NULL>x" entries got created while loading
the cyclades driver with devfs.

Several drivers do not set driver->devfs_name, so better skip registration
for those.

--- linux-2.6.3/drivers/char/tty_io.c.orig	2004-02-27 18:29:16.641482744 -0300
+++ linux-2.6.3/drivers/char/tty_io.c	2004-02-27 18:30:08.437608536 -0300
@@ -2099,7 +2099,8 @@
 		return;
 	}

-	devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR,
+	if (driver->devfs_name)
+		devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR,
 			"%s%d", driver->devfs_name, index + driver->name_base);

 	/* we don't care about the ptys */
@@ -2121,7 +2122,8 @@
  */
 void tty_unregister_device(struct tty_driver *driver, unsigned index)
 {
-	devfs_remove("%s%d", driver->devfs_name, index + driver->name_base);
+	if (driver->devfs_name)
+		devfs_remove("%s%d", driver->devfs_name, index + driver->name_base);
 	class_simple_device_remove(MKDEV(driver->major, driver->minor_start) + index);
 }


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-27 21:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-27 21:36 [PATCH] tty_io: Do not register NULL /dev entries on devfs Marcelo Tosatti
2004-02-27 20:48 ` Christoph Hellwig
2004-02-27 22:22   ` [PATCH] Fix tty drivers which dont set tty_driver->devfs_name Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®