summaryrefslogtreecommitdiffstats
path: root/sound/oss/msnd_pinnacle.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-07-11 12:16:36 +0200
committerTakashi Iwai <tiwai@suse.de>2010-07-12 17:41:05 +0200
commit90dc763fef4c869e60b2a7ad92e1a7dab68575ea (patch)
treeab3757f14a6d84e36afa36ac5f325fd316d4e197 /sound/oss/msnd_pinnacle.c
parent395c61d19621e80b763810cc988416dc1b6bfd3e (diff)
downloadlinux-90dc763fef4c869e60b2a7ad92e1a7dab68575ea.tar.gz
linux-90dc763fef4c869e60b2a7ad92e1a7dab68575ea.tar.bz2
linux-90dc763fef4c869e60b2a7ad92e1a7dab68575ea.zip
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>
Diffstat (limited to 'sound/oss/msnd_pinnacle.c')
-rw-r--r--sound/oss/msnd_pinnacle.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c
index a1e3f9671bea..153d822bf9a3 100644
--- a/sound/oss/msnd_pinnacle.c
+++ b/sound/oss/msnd_pinnacle.c
@@ -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;
}