diff options
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/proc_tty.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c index 854827b1d463..83adcc869437 100644 --- a/fs/proc/proc_tty.c +++ b/fs/proc/proc_tty.c | |||
@@ -144,22 +144,12 @@ 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->driver_name || driver->proc_entry) | 147 | if (!driver->driver_name || driver->proc_entry || |
148 | !driver->ops->proc_fops) | ||
148 | return; | 149 | return; |
149 | 150 | ||
150 | if (driver->ops->proc_fops) { | 151 | ent = proc_create_data(driver->driver_name, 0, proc_tty_driver, |
151 | ent = proc_create_data(driver->driver_name, 0, proc_tty_driver, | 152 | driver->ops->proc_fops, 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 | ||
162 | return; | ||
163 | driver->proc_entry = ent; | 153 | driver->proc_entry = ent; |
164 | } | 154 | } |
165 | 155 | ||