diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-07-11 12:16:36 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-07-12 17:41:05 +0200 |
commit | 90dc763fef4c869e60b2a7ad92e1a7dab68575ea (patch) | |
tree | ab3757f14a6d84e36afa36ac5f325fd316d4e197 /sound/oss/sh_dac_audio.c | |
parent | 395c61d19621e80b763810cc988416dc1b6bfd3e (diff) |
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/sh_dac_audio.c')
-rw-r--r-- | sound/oss/sh_dac_audio.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/oss/sh_dac_audio.c b/sound/oss/sh_dac_audio.c index 4153752507e..8f0be4053a5 100644 --- a/sound/oss/sh_dac_audio.c +++ b/sound/oss/sh_dac_audio.c @@ -16,6 +16,7 @@ #include <linux/slab.h> #include <linux/fs.h> #include <linux/sound.h> +#include <linux/smp_lock.h> #include <linux/soundcard.h> #include <linux/interrupt.h> #include <linux/hrtimer.h> @@ -216,13 +217,17 @@ static int dac_audio_open(struct inode *inode, struct file *file) { if (file->f_mode & FMODE_READ) return -ENODEV; - if (in_use) + + lock_kernel(); + if (in_use) { + unlock_kernel(); return -EBUSY; + } in_use = 1; dac_audio_start(); - + unlock_kernel(); return 0; } |