mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: torvalds@osdl.org
Cc: Russell King <rmk+lkml@arm.linux.org.uk>, linux-kernel@vger.kernel.org
Subject: [PATCH] tty_io: Do not register NULL /dev entries on devfs
Date: Fri, 27 Feb 2004 18:36:47 -0300 (BRT)	[thread overview]
Message-ID: <Pine.LNX.4.58L.0402271831080.19454@logos.cnet> (raw)


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);
 }


             reply	other threads:[~2004-02-27 20:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-27 21:36 Marcelo Tosatti [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58L.0402271831080.19454@logos.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®