summaryrefslogtreecommitdiffstats
path: root/drivers/sound
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/sound
parentf7ff3f5a67747c7714c3db772d05965a0c033705 (diff)
Merge with Linux 2.4.0-test5-pre5.
Diffstat (limited to 'drivers/sound')
-rw-r--r--drivers/sound/sound_core.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/sound/sound_core.c b/drivers/sound/sound_core.c
index 938b77968..aa2890f05 100644
--- a/drivers/sound/sound_core.c
+++ b/drivers/sound/sound_core.c
@@ -479,6 +479,7 @@ int soundcore_open(struct inode *inode, struct file *file)
int chain;
int unit=MINOR(inode->i_rdev);
struct sound_unit *s;
+ struct file_operations *new_fops = NULL;
chain=unit&0x0F;
if(chain==4 || chain==5) /* dsp/audio/dsp16 */
@@ -490,7 +491,9 @@ int soundcore_open(struct inode *inode, struct file *file)
spin_lock(&sound_loader_lock);
s = __look_for_unit(chain, unit);
- if (s == NULL) {
+ if (s)
+ new_fops = fops_get(s->unit_fops);
+ if (!new_fops) {
char mod[32];
spin_unlock(&sound_loader_lock);
@@ -507,8 +510,10 @@ int soundcore_open(struct inode *inode, struct file *file)
request_module(mod);
spin_lock(&sound_loader_lock);
s = __look_for_unit(chain, unit);
+ if (s)
+ new_fops = fops_get(s->unit_fops);
}
- if (s) {
+ if (new_fops) {
/*
* We rely upon the fact that we can't be unloaded while the
* subdriver is there, so if ->open() is successful we can
@@ -518,7 +523,7 @@ int soundcore_open(struct inode *inode, struct file *file)
*/
int err = 0;
struct file_operations *old_fops = file->f_op;
- file->f_op = fops_get(s->unit_fops);
+ file->f_op = new_fops;
spin_unlock(&sound_loader_lock);
if(file->f_op->open)
err = file->f_op->open(inode,file);