diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-10-25 11:56:32 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-10-25 11:56:32 +0400 |
commit | 79fc84c7e0d2fe89c4e82f3a26fd8b0d13c31703 (patch) | |
tree | e32a4c267dc1b5950012e18c1e71d8057140f1f5 /sound/oss/msnd_pinnacle.c | |
parent | f6f94e2ab1b33f0082ac22d71f66385a60d8157f (diff) | |
parent | 97c44b2dbd0060e2e6bd56236eb638ab02ec7f30 (diff) | |
download | linux-79fc84c7e0d2fe89c4e82f3a26fd8b0d13c31703.tar.xz |
Merge branch 'topic/misc' into for-linus
Diffstat (limited to 'sound/oss/msnd_pinnacle.c')
-rw-r--r-- | sound/oss/msnd_pinnacle.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c index 2e48b17667d0..b4c1eb504c22 100644 --- a/sound/oss/msnd_pinnacle.c +++ b/sound/oss/msnd_pinnacle.c @@ -39,7 +39,7 @@ #include <linux/delay.h> #include <linux/init.h> #include <linux/interrupt.h> -#include <linux/smp_lock.h> +#include <linux/mutex.h> #include <linux/gfp.h> #include <asm/irq.h> #include <asm/io.h> @@ -79,6 +79,7 @@ dev.rec_sample_rate / \ dev.rec_channels) +static DEFINE_MUTEX(msnd_pinnacle_mutex); static multisound_dev_t dev; #ifndef HAVE_DSPCODEH @@ -651,12 +652,12 @@ static long dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ret = -EINVAL; - lock_kernel(); + mutex_lock(&msnd_pinnacle_mutex); if (minor == dev.dsp_minor) ret = dsp_ioctl(file, cmd, arg); else if (minor == dev.mixer_minor) ret = mixer_ioctl(cmd, arg); - unlock_kernel(); + mutex_unlock(&msnd_pinnacle_mutex); return ret; } @@ -761,7 +762,7 @@ static int dev_open(struct inode *inode, struct file *file) int minor = iminor(inode); int err = 0; - lock_kernel(); + mutex_lock(&msnd_pinnacle_mutex); if (minor == dev.dsp_minor) { if ((file->f_mode & FMODE_WRITE && test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) || @@ -791,7 +792,7 @@ static int dev_open(struct inode *inode, struct file *file) } else err = -EINVAL; out: - unlock_kernel(); + mutex_unlock(&msnd_pinnacle_mutex); return err; } @@ -800,14 +801,14 @@ static int dev_release(struct inode *inode, struct file *file) int minor = iminor(inode); int err = 0; - lock_kernel(); + mutex_lock(&msnd_pinnacle_mutex); if (minor == dev.dsp_minor) err = dsp_release(file); else if (minor == dev.mixer_minor) { /* nothing */ } else err = -EINVAL; - unlock_kernel(); + mutex_unlock(&msnd_pinnacle_mutex); return err; } |