aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/proc/proc_tty.c20
-rw-r--r--include/linux/tty_driver.h1
2 files changed, 14 insertions, 7 deletions
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index 4a9e0f65ae60..854827b1d463 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -144,16 +144,22 @@ void proc_tty_register_driver(struct tty_driver *driver)
144{ 144{
145 struct proc_dir_entry *ent; 145 struct proc_dir_entry *ent;
146 146
147 if (!driver->ops->read_proc || !driver->driver_name || 147 if (!driver->driver_name || driver->proc_entry)
148 driver->proc_entry)
149 return; 148 return;
150 149
151 ent = create_proc_entry(driver->driver_name, 0, proc_tty_driver); 150 if (driver->ops->proc_fops) {
152 if (!ent) 151 ent = proc_create_data(driver->driver_name, 0, proc_tty_driver,
152 driver->ops->proc_fops, driver);
153 if (!ent)
154 return;
155 } else if (driver->ops->read_proc) {
156 ent = create_proc_entry(driver->driver_name, 0, proc_tty_driver);
157 if (!ent)
158 return;
159 ent->read_proc = driver->ops->read_proc;
160 ent->data = driver;
161 } else
153 return; 162 return;
154 ent->read_proc = driver->ops->read_proc;
155 ent->data = driver;
156
157 driver->proc_entry = ent; 163 driver->proc_entry = ent;
158} 164}
159 165
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 08e088334dba..c9a69575ded6 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -264,6 +264,7 @@ struct tty_operations {
264 int (*poll_get_char)(struct tty_driver *driver, int line); 264 int (*poll_get_char)(struct tty_driver *driver, int line);
265 void (*poll_put_char)(struct tty_driver *driver, int line, char ch); 265 void (*poll_put_char)(struct tty_driver *driver, int line, char ch);
266#endif 266#endif
267 const struct file_operations *proc_fops;
267}; 268};
268 269
269struct tty_driver { 270struct tty_driver {