From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Driver Core patches for 2.6.9-rc1
Date: Wed, 25 Aug 2004 15:36:27 -0700 [thread overview]
Message-ID: <10934733873593@kroah.com> (raw)
In-Reply-To: <1093473387435@kroah.com>
ChangeSet 1.1803.64.3, 2004/08/10 14:47:24-07:00, olh@suse.de
[PATCH] export legacy pty info via sysfs
You missed that one last year.
export the legacy pty/tty device nodes via sysfs,
so udev has a chance to create them if /dev is in tmpfs.
Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/char/tty_io.c | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diff -Nru a/drivers/char/tty_io.c b/drivers/char/tty_io.c
--- a/drivers/char/tty_io.c 2004-08-25 14:56:56 -07:00
+++ b/drivers/char/tty_io.c 2004-08-25 14:56:56 -07:00
@@ -766,6 +766,17 @@
return tty_write(file, buf, count, ppos);
}
+static char ptychar[] = "pqrstuvwxyzabcde";
+
+static inline void pty_line_name(struct tty_driver *driver, int index, char *p)
+{
+ int i = index + driver->name_base;
+ /* ->name is initialized to "ttyp", but "tty" is expected */
+ sprintf(p, "%s%c%x",
+ driver->subtype == PTY_TYPE_SLAVE ? "tty" : driver->name,
+ ptychar[i >> 4 & 0xf], i & 0xf);
+}
+
static inline void tty_line_name(struct tty_driver *driver, int index, char *p)
{
sprintf(p, "%s%d", driver->name, index + driver->name_base);
@@ -2170,6 +2181,7 @@
void tty_register_device(struct tty_driver *driver, unsigned index,
struct device *device)
{
+ char name[64];
dev_t dev = MKDEV(driver->major, driver->minor_start) + index;
if (index >= driver->num) {
@@ -2181,13 +2193,11 @@
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 */
- /* how nice to hide this behind some crappy interface.. */
- if (driver->type != TTY_DRIVER_TYPE_PTY) {
- char name[64];
+ if (driver->type == TTY_DRIVER_TYPE_PTY)
+ pty_line_name(driver, index, name);
+ else
tty_line_name(driver, index, name);
- class_simple_device_add(tty_class, dev, device, name);
- }
+ class_simple_device_add(tty_class, dev, device, name);
}
/**
next prev parent reply other threads:[~2004-08-25 22:50 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-25 22:35 [BK PATCH] Driver Core patches for 2.6.9-rc1 Greg KH
2005-05-19 6:25 ` Greg KH
2004-08-25 22:36 ` [PATCH] " Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH [this message]
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-25 22:36 ` Greg KH
2004-08-26 2:04 ` Benjamin Herrenschmidt
2004-08-26 4:10 ` Greg KH
2005-05-19 6:25 ` Greg KH
2004-08-26 12:26 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2004-08-26 23:33 ` Benjamin Herrenschmidt
2005-05-19 6:25 ` Benjamin Herrenschmidt
2004-08-27 10:16 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
-- strict thread matches above, loose matches on Subject: below --
2004-08-26 18:15 Margit Schubert-While
[not found] <200408261957.58105.margitsw@t-online.de>
[not found] ` <5.1.0.14.2.20040908220127.02a9daa8@pop.t-online.de>
2004-09-08 20:21 ` Greg KH
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=10934733873593@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.