From bd2747897d541a29a7015707bf28651b8ff055b2 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 31 Mar 2009 15:19:15 -0700 Subject: [PATCH] --- yaml --- r: 139119 b: refs/heads/master c: ae149b6bec64a09373ba20fce75f8aa6b14b78fd h: refs/heads/master i: 139117: c9f6c557fbf6ffb8a8953fdef9a31332d2eaf0fd 139115: 9ef39bfb38953995b638d4da52c94591f8a3c112 139111: dcefc3257521e0c535cc39b75f5876561ee57358 139103: 8db4e371c276cbfdac801d46636981b7d63d8d01 v: v3 --- [refs] | 2 +- trunk/fs/proc/proc_tty.c | 20 +++++++++++++------- trunk/include/linux/tty_driver.h | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 9faad20099ce..818570b98234 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 15f7176eb1cccec0a332541285ee752b935c1c85 +refs/heads/master: ae149b6bec64a09373ba20fce75f8aa6b14b78fd diff --git a/trunk/fs/proc/proc_tty.c b/trunk/fs/proc/proc_tty.c index 4a9e0f65ae60..854827b1d463 100644 --- a/trunk/fs/proc/proc_tty.c +++ b/trunk/fs/proc/proc_tty.c @@ -144,16 +144,22 @@ void proc_tty_register_driver(struct tty_driver *driver) { struct proc_dir_entry *ent; - if (!driver->ops->read_proc || !driver->driver_name || - driver->proc_entry) + if (!driver->driver_name || driver->proc_entry) return; - ent = create_proc_entry(driver->driver_name, 0, proc_tty_driver); - if (!ent) + if (driver->ops->proc_fops) { + ent = proc_create_data(driver->driver_name, 0, proc_tty_driver, + driver->ops->proc_fops, driver); + if (!ent) + return; + } else if (driver->ops->read_proc) { + ent = create_proc_entry(driver->driver_name, 0, proc_tty_driver); + if (!ent) + return; + ent->read_proc = driver->ops->read_proc; + ent->data = driver; + } else return; - ent->read_proc = driver->ops->read_proc; - ent->data = driver; - driver->proc_entry = ent; } diff --git a/trunk/include/linux/tty_driver.h b/trunk/include/linux/tty_driver.h index 08e088334dba..c9a69575ded6 100644 --- a/trunk/include/linux/tty_driver.h +++ b/trunk/include/linux/tty_driver.h @@ -264,6 +264,7 @@ struct tty_operations { int (*poll_get_char)(struct tty_driver *driver, int line); void (*poll_put_char)(struct tty_driver *driver, int line, char ch); #endif + const struct file_operations *proc_fops; }; struct tty_driver {