diff options
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 ca942f7cd23..7b5c77b32a9 100644 --- a/sound/oss/msnd_pinnacle.c +++ b/sound/oss/msnd_pinnacle.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <linux/delay.h> | 39 | #include <linux/delay.h> |
40 | #include <linux/init.h> | 40 | #include <linux/init.h> |
41 | #include <linux/interrupt.h> | 41 | #include <linux/interrupt.h> |
42 | #include <linux/smp_lock.h> | 42 | #include <linux/mutex.h> |
43 | #include <linux/gfp.h> | 43 | #include <linux/gfp.h> |
44 | #include <asm/irq.h> | 44 | #include <asm/irq.h> |
45 | #include <asm/io.h> | 45 | #include <asm/io.h> |
@@ -79,6 +79,7 @@ | |||
79 | dev.rec_sample_rate / \ | 79 | dev.rec_sample_rate / \ |
80 | dev.rec_channels) | 80 | dev.rec_channels) |
81 | 81 | ||
82 | static DEFINE_MUTEX(msnd_pinnacle_mutex); | ||
82 | static multisound_dev_t dev; | 83 | static multisound_dev_t dev; |
83 | 84 | ||
84 | #ifndef HAVE_DSPCODEH | 85 | #ifndef HAVE_DSPCODEH |
@@ -651,12 +652,12 @@ static long dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
651 | 652 | ||
652 | ret = -EINVAL; | 653 | ret = -EINVAL; |
653 | 654 | ||
654 | lock_kernel(); | 655 | mutex_lock(&msnd_pinnacle_mutex); |
655 | if (minor == dev.dsp_minor) | 656 | if (minor == dev.dsp_minor) |
656 | ret = dsp_ioctl(file, cmd, arg); | 657 | ret = dsp_ioctl(file, cmd, arg); |
657 | else if (minor == dev.mixer_minor) | 658 | else if (minor == dev.mixer_minor) |
658 | ret = mixer_ioctl(cmd, arg); | 659 | ret = mixer_ioctl(cmd, arg); |
659 | unlock_kernel(); | 660 | mutex_unlock(&msnd_pinnacle_mutex); |
660 | 661 | ||
661 | return ret; | 662 | return ret; |
662 | } | 663 | } |
@@ -761,7 +762,7 @@ static int dev_open(struct inode *inode, struct file *file) | |||
761 | int minor = iminor(inode); | 762 | int minor = iminor(inode); |
762 | int err = 0; | 763 | int err = 0; |
763 | 764 | ||
764 | lock_kernel(); | 765 | mutex_lock(&msnd_pinnacle_mutex); |
765 | if (minor == dev.dsp_minor) { | 766 | if (minor == dev.dsp_minor) { |
766 | if ((file->f_mode & FMODE_WRITE && | 767 | if ((file->f_mode & FMODE_WRITE && |
767 | test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) || | 768 | test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) || |
@@ -791,7 +792,7 @@ static int dev_open(struct inode *inode, struct file *file) | |||
791 | } else | 792 | } else |
792 | err = -EINVAL; | 793 | err = -EINVAL; |
793 | out: | 794 | out: |
794 | unlock_kernel(); | 795 | mutex_unlock(&msnd_pinnacle_mutex); |
795 | return err; | 796 | return err; |
796 | } | 797 | } |
797 | 798 | ||
@@ -800,14 +801,14 @@ static int dev_release(struct inode *inode, struct file *file) | |||
800 | int minor = iminor(inode); | 801 | int minor = iminor(inode); |
801 | int err = 0; | 802 | int err = 0; |
802 | 803 | ||
803 | lock_kernel(); | 804 | mutex_lock(&msnd_pinnacle_mutex); |
804 | if (minor == dev.dsp_minor) | 805 | if (minor == dev.dsp_minor) |
805 | err = dsp_release(file); | 806 | err = dsp_release(file); |
806 | else if (minor == dev.mixer_minor) { | 807 | else if (minor == dev.mixer_minor) { |
807 | /* nothing */ | 808 | /* nothing */ |
808 | } else | 809 | } else |
809 | err = -EINVAL; | 810 | err = -EINVAL; |
810 | unlock_kernel(); | 811 | mutex_unlock(&msnd_pinnacle_mutex); |
811 | return err; | 812 | return err; |
812 | } | 813 | } |
813 | 814 | ||