diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-07-11 06:16:36 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-07-12 11:41:05 -0400 |
commit | 90dc763fef4c869e60b2a7ad92e1a7dab68575ea (patch) | |
tree | ab3757f14a6d84e36afa36ac5f325fd316d4e197 /sound/oss/msnd_pinnacle.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/msnd_pinnacle.c')
-rw-r--r-- | sound/oss/msnd_pinnacle.c | 10 |
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) | |||
756 | int minor = iminor(inode); | 756 | int minor = iminor(inode); |
757 | int err = 0; | 757 | int err = 0; |
758 | 758 | ||
759 | lock_kernel(); | ||
759 | if (minor == dev.dsp_minor) { | 760 | if (minor == dev.dsp_minor) { |
760 | if ((file->f_mode & FMODE_WRITE && | 761 | if ((file->f_mode & FMODE_WRITE && |
761 | test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) || | 762 | test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) || |
762 | (file->f_mode & FMODE_READ && | 763 | (file->f_mode & FMODE_READ && |
763 | test_bit(F_AUDIO_READ_INUSE, &dev.flags))) | 764 | test_bit(F_AUDIO_READ_INUSE, &dev.flags))) { |
764 | return -EBUSY; | 765 | err = -EBUSY; |
766 | goto out; | ||
767 | } | ||
765 | 768 | ||
766 | if ((err = dsp_open(file)) >= 0) { | 769 | if ((err = dsp_open(file)) >= 0) { |
767 | dev.nresets = 0; | 770 | dev.nresets = 0; |
@@ -782,7 +785,8 @@ static int dev_open(struct inode *inode, struct file *file) | |||
782 | /* nothing */ | 785 | /* nothing */ |
783 | } else | 786 | } else |
784 | err = -EINVAL; | 787 | err = -EINVAL; |
785 | 788 | out: | |
789 | unlock_kernel(); | ||
786 | return err; | 790 | return err; |
787 | } | 791 | } |
788 | 792 | ||