summaryrefslogtreecommitdiffstats
path: root/drivers/telephony
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-07-27 23:20:03 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-07-27 23:20:03 +0000
commit89eba5eb77bbf92ffed6686c951cc35f4027e71f (patch)
treeb56887b1753ca2573002bc7f60e5f3e47c33b116 /drivers/telephony
parentf7ff3f5a67747c7714c3db772d05965a0c033705 (diff)
Merge with Linux 2.4.0-test5-pre5.
Diffstat (limited to 'drivers/telephony')
-rw-r--r--drivers/telephony/phonedev.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c
index 3fde30bfa..74abe1bf9 100644
--- a/drivers/telephony/phonedev.c
+++ b/drivers/telephony/phonedev.c
@@ -49,14 +49,16 @@ static int phone_open(struct inode *inode, struct file *file)
unsigned int minor = MINOR(inode->i_rdev);
int err = 0;
struct phone_device *p;
- struct file_operations *old_fops;
+ struct file_operations *old_fops, *new_fops = NULL;
if (minor >= PHONE_NUM_DEVICES)
return -ENODEV;
down(&phone_lock);
p = phone_device[minor];
- if (p == NULL) {
+ if (p)
+ new_fops = fops_get(p->f_op);
+ if (!new_fops) {
char modname[32];
up(&phone_lock);
@@ -64,14 +66,14 @@ static int phone_open(struct inode *inode, struct file *file)
request_module(modname);
down(&phone_lock);
p = phone_device[minor];
- if (p == NULL)
+ if (p == NULL || (new_fops = fops_get(p->f_op)) == NULL)
{
err=-ENODEV;
goto end;
}
}
old_fops = file->f_op;
- file->f_op = fops_get(p->f_op);
+ file->f_op = new_fops;
if (p->open)
err = p->open(p, file); /* Tell the device it is open */
if (err) {