sound: push BKL into open functions

This moves the lock_kernel() call from soundcore_open
to the individual OSS device drivers, where we can deal
with it one driver at a time if needed, or just kill
off the drivers.

All core components in ALSA already provide
adequate locking in their open()-functions
and do not require the big kernel lock, so
there is no need to add the BKL there.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Arnd Bergmann
2010-07-11 12:16:36 +02:00
committed by Takashi Iwai
父節點 395c61d196
當前提交 90dc763fef
共有 9 個文件被更改,包括 95 次插入35 次删除

查看文件

@@ -756,12 +756,15 @@ static int dev_open(struct inode *inode, struct file *file)
int minor = iminor(inode);
int err = 0;
lock_kernel();
if (minor == dev.dsp_minor) {
if ((file->f_mode & FMODE_WRITE &&
test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) ||
(file->f_mode & FMODE_READ &&
test_bit(F_AUDIO_READ_INUSE, &dev.flags)))
return -EBUSY;
test_bit(F_AUDIO_READ_INUSE, &dev.flags))) {
err = -EBUSY;
goto out;
}
if ((err = dsp_open(file)) >= 0) {
dev.nresets = 0;
@@ -782,7 +785,8 @@ static int dev_open(struct inode *inode, struct file *file)
/* nothing */
} else
err = -EINVAL;
out:
unlock_kernel();
return err;
}