aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/arm/aaci.c10
-rw-r--r--sound/arm/aaci.h2
-rw-r--r--sound/arm/pxa2xx-ac97.c12
-rw-r--r--sound/pcmcia/vx/vxp_mixer.c12
-rw-r--r--sound/sparc/cs4231.c34
-rw-r--r--sound/usb/usbaudio.c15
-rw-r--r--sound/usb/usx2y/usbusx2y.c2
-rw-r--r--sound/usb/usx2y/usbusx2y.h2
-rw-r--r--sound/usb/usx2y/usbusx2yaudio.c8
-rw-r--r--sound/usb/usx2y/usx2yhwdeppcm.c12
10 files changed, 55 insertions, 54 deletions
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
index 149feb410654..5f22d70fefc0 100644
--- a/sound/arm/aaci.c
+++ b/sound/arm/aaci.c
@@ -73,7 +73,7 @@ static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned
73 if (ac97->num >= 4) 73 if (ac97->num >= 4)
74 return; 74 return;
75 75
76 down(&aaci->ac97_sem); 76 mutex_lock(&aaci->ac97_sem);
77 77
78 aaci_ac97_select_codec(aaci, ac97); 78 aaci_ac97_select_codec(aaci, ac97);
79 79
@@ -91,7 +91,7 @@ static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned
91 v = readl(aaci->base + AACI_SLFR); 91 v = readl(aaci->base + AACI_SLFR);
92 } while (v & (SLFR_1TXB|SLFR_2TXB)); 92 } while (v & (SLFR_1TXB|SLFR_2TXB));
93 93
94 up(&aaci->ac97_sem); 94 mutex_unlock(&aaci->ac97_sem);
95} 95}
96 96
97/* 97/*
@@ -105,7 +105,7 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
105 if (ac97->num >= 4) 105 if (ac97->num >= 4)
106 return ~0; 106 return ~0;
107 107
108 down(&aaci->ac97_sem); 108 mutex_lock(&aaci->ac97_sem);
109 109
110 aaci_ac97_select_codec(aaci, ac97); 110 aaci_ac97_select_codec(aaci, ac97);
111 111
@@ -145,7 +145,7 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
145 v = ~0; 145 v = ~0;
146 } 146 }
147 147
148 up(&aaci->ac97_sem); 148 mutex_unlock(&aaci->ac97_sem);
149 return v; 149 return v;
150} 150}
151 151
@@ -783,7 +783,7 @@ static struct aaci * __devinit aaci_init_card(struct amba_device *dev)
783 card->shortname, dev->res.start, dev->irq[0]); 783 card->shortname, dev->res.start, dev->irq[0]);
784 784
785 aaci = card->private_data; 785 aaci = card->private_data;
786 init_MUTEX(&aaci->ac97_sem); 786 mutex_init(&aaci->ac97_sem);
787 spin_lock_init(&aaci->lock); 787 spin_lock_init(&aaci->lock);
788 aaci->card = card; 788 aaci->card = card;
789 aaci->dev = dev; 789 aaci->dev = dev;
diff --git a/sound/arm/aaci.h b/sound/arm/aaci.h
index 83f73c2505c6..06295190606c 100644
--- a/sound/arm/aaci.h
+++ b/sound/arm/aaci.h
@@ -227,7 +227,7 @@ struct aaci {
227 unsigned int fifosize; 227 unsigned int fifosize;
228 228
229 /* AC'97 */ 229 /* AC'97 */
230 struct semaphore ac97_sem; 230 struct mutex ac97_sem;
231 ac97_bus_t *ac97_bus; 231 ac97_bus_t *ac97_bus;
232 232
233 u32 maincr; 233 u32 maincr;
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index 3acbc6023d19..599aff8290e8 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -25,7 +25,7 @@
25#include <sound/initval.h> 25#include <sound/initval.h>
26 26
27#include <asm/irq.h> 27#include <asm/irq.h>
28#include <asm/semaphore.h> 28#include <linux/mutex.h>
29#include <asm/hardware.h> 29#include <asm/hardware.h>
30#include <asm/arch/pxa-regs.h> 30#include <asm/arch/pxa-regs.h>
31#include <asm/arch/audio.h> 31#include <asm/arch/audio.h>
@@ -33,7 +33,7 @@
33#include "pxa2xx-pcm.h" 33#include "pxa2xx-pcm.h"
34 34
35 35
36static DECLARE_MUTEX(car_mutex); 36static DEFINE_MUTEX(car_mutex);
37static DECLARE_WAIT_QUEUE_HEAD(gsr_wq); 37static DECLARE_WAIT_QUEUE_HEAD(gsr_wq);
38static volatile long gsr_bits; 38static volatile long gsr_bits;
39 39
@@ -52,7 +52,7 @@ static unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97, unsigned short reg
52 unsigned short val = -1; 52 unsigned short val = -1;
53 volatile u32 *reg_addr; 53 volatile u32 *reg_addr;
54 54
55 down(&car_mutex); 55 mutex_lock(&car_mutex);
56 56
57 /* set up primary or secondary codec space */ 57 /* set up primary or secondary codec space */
58 reg_addr = (ac97->num & 1) ? &SAC_REG_BASE : &PAC_REG_BASE; 58 reg_addr = (ac97->num & 1) ? &SAC_REG_BASE : &PAC_REG_BASE;
@@ -79,7 +79,7 @@ static unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97, unsigned short reg
79 /* but we've just started another cycle... */ 79 /* but we've just started another cycle... */
80 wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1); 80 wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1);
81 81
82out: up(&car_mutex); 82out: mutex_unlock(&car_mutex);
83 return val; 83 return val;
84} 84}
85 85
@@ -87,7 +87,7 @@ static void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigne
87{ 87{
88 volatile u32 *reg_addr; 88 volatile u32 *reg_addr;
89 89
90 down(&car_mutex); 90 mutex_lock(&car_mutex);
91 91
92 /* set up primary or secondary codec space */ 92 /* set up primary or secondary codec space */
93 reg_addr = (ac97->num & 1) ? &SAC_REG_BASE : &PAC_REG_BASE; 93 reg_addr = (ac97->num & 1) ? &SAC_REG_BASE : &PAC_REG_BASE;
@@ -101,7 +101,7 @@ static void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigne
101 printk(KERN_ERR "%s: write error (ac97_reg=%d GSR=%#lx)\n", 101 printk(KERN_ERR "%s: write error (ac97_reg=%d GSR=%#lx)\n",
102 __FUNCTION__, reg, GSR | gsr_bits); 102 __FUNCTION__, reg, GSR | gsr_bits);
103 103
104 up(&car_mutex); 104 mutex_unlock(&car_mutex);
105} 105}
106 106
107static void pxa2xx_ac97_reset(struct snd_ac97 *ac97) 107static void pxa2xx_ac97_reset(struct snd_ac97 *ac97)
diff --git a/sound/pcmcia/vx/vxp_mixer.c b/sound/pcmcia/vx/vxp_mixer.c
index 9450149b931c..e237f6c2018f 100644
--- a/sound/pcmcia/vx/vxp_mixer.c
+++ b/sound/pcmcia/vx/vxp_mixer.c
@@ -52,14 +52,14 @@ static int vx_mic_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v
52{ 52{
53 struct vx_core *_chip = snd_kcontrol_chip(kcontrol); 53 struct vx_core *_chip = snd_kcontrol_chip(kcontrol);
54 struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; 54 struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
55 down(&_chip->mixer_mutex); 55 mutex_lock(&_chip->mixer_mutex);
56 if (chip->mic_level != ucontrol->value.integer.value[0]) { 56 if (chip->mic_level != ucontrol->value.integer.value[0]) {
57 vx_set_mic_level(_chip, ucontrol->value.integer.value[0]); 57 vx_set_mic_level(_chip, ucontrol->value.integer.value[0]);
58 chip->mic_level = ucontrol->value.integer.value[0]; 58 chip->mic_level = ucontrol->value.integer.value[0];
59 up(&_chip->mixer_mutex); 59 mutex_unlock(&_chip->mixer_mutex);
60 return 1; 60 return 1;
61 } 61 }
62 up(&_chip->mixer_mutex); 62 mutex_unlock(&_chip->mixer_mutex);
63 return 0; 63 return 0;
64} 64}
65 65
@@ -95,14 +95,14 @@ static int vx_mic_boost_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v
95{ 95{
96 struct vx_core *_chip = snd_kcontrol_chip(kcontrol); 96 struct vx_core *_chip = snd_kcontrol_chip(kcontrol);
97 struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; 97 struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
98 down(&_chip->mixer_mutex); 98 mutex_lock(&_chip->mixer_mutex);
99 if (chip->mic_level != ucontrol->value.integer.value[0]) { 99 if (chip->mic_level != ucontrol->value.integer.value[0]) {
100 vx_set_mic_boost(_chip, ucontrol->value.integer.value[0]); 100 vx_set_mic_boost(_chip, ucontrol->value.integer.value[0]);
101 chip->mic_level = ucontrol->value.integer.value[0]; 101 chip->mic_level = ucontrol->value.integer.value[0];
102 up(&_chip->mixer_mutex); 102 mutex_unlock(&_chip->mixer_mutex);
103 return 1; 103 return 1;
104 } 104 }
105 up(&_chip->mixer_mutex); 105 mutex_unlock(&_chip->mixer_mutex);
106 return 0; 106 return 0;
107} 107}
108 108
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index fd6543998788..53a148b01b6b 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -115,8 +115,8 @@ struct snd_cs4231 {
115 unsigned char image[32]; /* registers image */ 115 unsigned char image[32]; /* registers image */
116 int mce_bit; 116 int mce_bit;
117 int calibrate_mute; 117 int calibrate_mute;
118 struct semaphore mce_mutex; 118 struct mutex mce_mutex;
119 struct semaphore open_mutex; 119 struct mutex open_mutex;
120 120
121 union { 121 union {
122#ifdef SBUS_SUPPORT 122#ifdef SBUS_SUPPORT
@@ -775,7 +775,7 @@ static void snd_cs4231_playback_format(struct snd_cs4231 *chip, struct snd_pcm_h
775{ 775{
776 unsigned long flags; 776 unsigned long flags;
777 777
778 down(&chip->mce_mutex); 778 mutex_lock(&chip->mce_mutex);
779 snd_cs4231_calibrate_mute(chip, 1); 779 snd_cs4231_calibrate_mute(chip, 1);
780 780
781 snd_cs4231_mce_up(chip); 781 snd_cs4231_mce_up(chip);
@@ -790,7 +790,7 @@ static void snd_cs4231_playback_format(struct snd_cs4231 *chip, struct snd_pcm_h
790 snd_cs4231_mce_down(chip); 790 snd_cs4231_mce_down(chip);
791 791
792 snd_cs4231_calibrate_mute(chip, 0); 792 snd_cs4231_calibrate_mute(chip, 0);
793 up(&chip->mce_mutex); 793 mutex_unlock(&chip->mce_mutex);
794} 794}
795 795
796static void snd_cs4231_capture_format(struct snd_cs4231 *chip, struct snd_pcm_hw_params *params, 796static void snd_cs4231_capture_format(struct snd_cs4231 *chip, struct snd_pcm_hw_params *params,
@@ -798,7 +798,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip, struct snd_pcm_hw
798{ 798{
799 unsigned long flags; 799 unsigned long flags;
800 800
801 down(&chip->mce_mutex); 801 mutex_lock(&chip->mce_mutex);
802 snd_cs4231_calibrate_mute(chip, 1); 802 snd_cs4231_calibrate_mute(chip, 1);
803 803
804 snd_cs4231_mce_up(chip); 804 snd_cs4231_mce_up(chip);
@@ -819,7 +819,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip, struct snd_pcm_hw
819 snd_cs4231_mce_down(chip); 819 snd_cs4231_mce_down(chip);
820 820
821 snd_cs4231_calibrate_mute(chip, 0); 821 snd_cs4231_calibrate_mute(chip, 0);
822 up(&chip->mce_mutex); 822 mutex_unlock(&chip->mce_mutex);
823} 823}
824 824
825/* 825/*
@@ -933,14 +933,14 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode)
933{ 933{
934 unsigned long flags; 934 unsigned long flags;
935 935
936 down(&chip->open_mutex); 936 mutex_lock(&chip->open_mutex);
937 if ((chip->mode & mode)) { 937 if ((chip->mode & mode)) {
938 up(&chip->open_mutex); 938 mutex_unlock(&chip->open_mutex);
939 return -EAGAIN; 939 return -EAGAIN;
940 } 940 }
941 if (chip->mode & CS4231_MODE_OPEN) { 941 if (chip->mode & CS4231_MODE_OPEN) {
942 chip->mode |= mode; 942 chip->mode |= mode;
943 up(&chip->open_mutex); 943 mutex_unlock(&chip->open_mutex);
944 return 0; 944 return 0;
945 } 945 }
946 /* ok. now enable and ack CODEC IRQ */ 946 /* ok. now enable and ack CODEC IRQ */
@@ -960,7 +960,7 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode)
960 spin_unlock_irqrestore(&chip->lock, flags); 960 spin_unlock_irqrestore(&chip->lock, flags);
961 961
962 chip->mode = mode; 962 chip->mode = mode;
963 up(&chip->open_mutex); 963 mutex_unlock(&chip->open_mutex);
964 return 0; 964 return 0;
965} 965}
966 966
@@ -968,10 +968,10 @@ static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode)
968{ 968{
969 unsigned long flags; 969 unsigned long flags;
970 970
971 down(&chip->open_mutex); 971 mutex_lock(&chip->open_mutex);
972 chip->mode &= ~mode; 972 chip->mode &= ~mode;
973 if (chip->mode & CS4231_MODE_OPEN) { 973 if (chip->mode & CS4231_MODE_OPEN) {
974 up(&chip->open_mutex); 974 mutex_unlock(&chip->open_mutex);
975 return; 975 return;
976 } 976 }
977 snd_cs4231_calibrate_mute(chip, 1); 977 snd_cs4231_calibrate_mute(chip, 1);
@@ -1008,7 +1008,7 @@ static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode)
1008 snd_cs4231_calibrate_mute(chip, 0); 1008 snd_cs4231_calibrate_mute(chip, 0);
1009 1009
1010 chip->mode = 0; 1010 chip->mode = 0;
1011 up(&chip->open_mutex); 1011 mutex_unlock(&chip->open_mutex);
1012} 1012}
1013 1013
1014/* 1014/*
@@ -1969,8 +1969,8 @@ static int __init snd_cs4231_sbus_create(struct snd_card *card,
1969 spin_lock_init(&chip->lock); 1969 spin_lock_init(&chip->lock);
1970 spin_lock_init(&chip->c_dma.sbus_info.lock); 1970 spin_lock_init(&chip->c_dma.sbus_info.lock);
1971 spin_lock_init(&chip->p_dma.sbus_info.lock); 1971 spin_lock_init(&chip->p_dma.sbus_info.lock);
1972 init_MUTEX(&chip->mce_mutex); 1972 mutex_init(&chip->mce_mutex);
1973 init_MUTEX(&chip->open_mutex); 1973 mutex_init(&chip->open_mutex);
1974 chip->card = card; 1974 chip->card = card;
1975 chip->dev_u.sdev = sdev; 1975 chip->dev_u.sdev = sdev;
1976 chip->regs_size = sdev->reg_addrs[0].reg_size; 1976 chip->regs_size = sdev->reg_addrs[0].reg_size;
@@ -2157,8 +2157,8 @@ static int __init snd_cs4231_ebus_create(struct snd_card *card,
2157 spin_lock_init(&chip->lock); 2157 spin_lock_init(&chip->lock);
2158 spin_lock_init(&chip->c_dma.ebus_info.lock); 2158 spin_lock_init(&chip->c_dma.ebus_info.lock);
2159 spin_lock_init(&chip->p_dma.ebus_info.lock); 2159 spin_lock_init(&chip->p_dma.ebus_info.lock);
2160 init_MUTEX(&chip->mce_mutex); 2160 mutex_init(&chip->mce_mutex);
2161 init_MUTEX(&chip->open_mutex); 2161 mutex_init(&chip->open_mutex);
2162 chip->flags |= CS4231_FLAG_EBUS; 2162 chip->flags |= CS4231_FLAG_EBUS;
2163 chip->card = card; 2163 chip->card = card;
2164 chip->dev_u.pdev = edev->bus->self; 2164 chip->dev_u.pdev = edev->bus->self;
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index c9476c237c42..53009bb642f6 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -47,6 +47,7 @@
47#include <linux/usb.h> 47#include <linux/usb.h>
48#include <linux/vmalloc.h> 48#include <linux/vmalloc.h>
49#include <linux/moduleparam.h> 49#include <linux/moduleparam.h>
50#include <linux/mutex.h>
50#include <sound/core.h> 51#include <sound/core.h>
51#include <sound/info.h> 52#include <sound/info.h>
52#include <sound/pcm.h> 53#include <sound/pcm.h>
@@ -202,7 +203,7 @@ struct snd_usb_stream {
202 * the all interfaces on the same card as one sound device. 203 * the all interfaces on the same card as one sound device.
203 */ 204 */
204 205
205static DECLARE_MUTEX(register_mutex); 206static DEFINE_MUTEX(register_mutex);
206static struct snd_usb_audio *usb_chip[SNDRV_CARDS]; 207static struct snd_usb_audio *usb_chip[SNDRV_CARDS];
207 208
208 209
@@ -3285,7 +3286,7 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
3285 3286
3286 /* check whether it's already registered */ 3287 /* check whether it's already registered */
3287 chip = NULL; 3288 chip = NULL;
3288 down(&register_mutex); 3289 mutex_lock(&register_mutex);
3289 for (i = 0; i < SNDRV_CARDS; i++) { 3290 for (i = 0; i < SNDRV_CARDS; i++) {
3290 if (usb_chip[i] && usb_chip[i]->dev == dev) { 3291 if (usb_chip[i] && usb_chip[i]->dev == dev) {
3291 if (usb_chip[i]->shutdown) { 3292 if (usb_chip[i]->shutdown) {
@@ -3338,13 +3339,13 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
3338 3339
3339 usb_chip[chip->index] = chip; 3340 usb_chip[chip->index] = chip;
3340 chip->num_interfaces++; 3341 chip->num_interfaces++;
3341 up(&register_mutex); 3342 mutex_unlock(&register_mutex);
3342 return chip; 3343 return chip;
3343 3344
3344 __error: 3345 __error:
3345 if (chip && !chip->num_interfaces) 3346 if (chip && !chip->num_interfaces)
3346 snd_card_free(chip->card); 3347 snd_card_free(chip->card);
3347 up(&register_mutex); 3348 mutex_unlock(&register_mutex);
3348 __err_val: 3349 __err_val:
3349 return NULL; 3350 return NULL;
3350} 3351}
@@ -3364,7 +3365,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
3364 3365
3365 chip = ptr; 3366 chip = ptr;
3366 card = chip->card; 3367 card = chip->card;
3367 down(&register_mutex); 3368 mutex_lock(&register_mutex);
3368 chip->shutdown = 1; 3369 chip->shutdown = 1;
3369 chip->num_interfaces--; 3370 chip->num_interfaces--;
3370 if (chip->num_interfaces <= 0) { 3371 if (chip->num_interfaces <= 0) {
@@ -3382,10 +3383,10 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
3382 snd_usb_mixer_disconnect(p); 3383 snd_usb_mixer_disconnect(p);
3383 } 3384 }
3384 usb_chip[chip->index] = NULL; 3385 usb_chip[chip->index] = NULL;
3385 up(&register_mutex); 3386 mutex_unlock(&register_mutex);
3386 snd_card_free(card); 3387 snd_card_free(card);
3387 } else { 3388 } else {
3388 up(&register_mutex); 3389 mutex_unlock(&register_mutex);
3389 } 3390 }
3390} 3391}
3391 3392
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
index e0abb56bbe49..cfec38d7839b 100644
--- a/sound/usb/usx2y/usbusx2y.c
+++ b/sound/usb/usx2y/usbusx2y.c
@@ -351,7 +351,7 @@ static struct snd_card *usX2Y_create_card(struct usb_device *device)
351 usX2Y(card)->chip.dev = device; 351 usX2Y(card)->chip.dev = device;
352 usX2Y(card)->chip.card = card; 352 usX2Y(card)->chip.card = card;
353 init_waitqueue_head(&usX2Y(card)->prepare_wait_queue); 353 init_waitqueue_head(&usX2Y(card)->prepare_wait_queue);
354 init_MUTEX (&usX2Y(card)->prepare_mutex); 354 mutex_init(&usX2Y(card)->prepare_mutex);
355 INIT_LIST_HEAD(&usX2Y(card)->chip.midi_list); 355 INIT_LIST_HEAD(&usX2Y(card)->chip.midi_list);
356 strcpy(card->driver, "USB "NAME_ALLCAPS""); 356 strcpy(card->driver, "USB "NAME_ALLCAPS"");
357 sprintf(card->shortname, "TASCAM "NAME_ALLCAPS""); 357 sprintf(card->shortname, "TASCAM "NAME_ALLCAPS"");
diff --git a/sound/usb/usx2y/usbusx2y.h b/sound/usb/usx2y/usbusx2y.h
index 435c1feda9df..456b5fdbc339 100644
--- a/sound/usb/usx2y/usbusx2y.h
+++ b/sound/usb/usx2y/usbusx2y.h
@@ -34,7 +34,7 @@ struct usX2Ydev {
34 unsigned int rate, 34 unsigned int rate,
35 format; 35 format;
36 int chip_status; 36 int chip_status;
37 struct semaphore prepare_mutex; 37 struct mutex prepare_mutex;
38 struct us428ctls_sharedmem *us428ctls_sharedmem; 38 struct us428ctls_sharedmem *us428ctls_sharedmem;
39 int wait_iso_frame; 39 int wait_iso_frame;
40 wait_queue_head_t us428ctls_wait_queue_head; 40 wait_queue_head_t us428ctls_wait_queue_head;
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
index a6bbc7a6348f..f6bd0dee563c 100644
--- a/sound/usb/usx2y/usbusx2yaudio.c
+++ b/sound/usb/usx2y/usbusx2yaudio.c
@@ -811,7 +811,7 @@ static int snd_usX2Y_pcm_hw_free(struct snd_pcm_substream *substream)
811{ 811{
812 struct snd_pcm_runtime *runtime = substream->runtime; 812 struct snd_pcm_runtime *runtime = substream->runtime;
813 struct snd_usX2Y_substream *subs = runtime->private_data; 813 struct snd_usX2Y_substream *subs = runtime->private_data;
814 down(&subs->usX2Y->prepare_mutex); 814 mutex_lock(&subs->usX2Y->prepare_mutex);
815 snd_printdd("snd_usX2Y_hw_free(%p)\n", substream); 815 snd_printdd("snd_usX2Y_hw_free(%p)\n", substream);
816 816
817 if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { 817 if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) {
@@ -832,7 +832,7 @@ static int snd_usX2Y_pcm_hw_free(struct snd_pcm_substream *substream)
832 usX2Y_urbs_release(subs); 832 usX2Y_urbs_release(subs);
833 } 833 }
834 } 834 }
835 up(&subs->usX2Y->prepare_mutex); 835 mutex_unlock(&subs->usX2Y->prepare_mutex);
836 return snd_pcm_lib_free_pages(substream); 836 return snd_pcm_lib_free_pages(substream);
837} 837}
838/* 838/*
@@ -849,7 +849,7 @@ static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream)
849 int err = 0; 849 int err = 0;
850 snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream); 850 snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream);
851 851
852 down(&usX2Y->prepare_mutex); 852 mutex_lock(&usX2Y->prepare_mutex);
853 usX2Y_subs_prepare(subs); 853 usX2Y_subs_prepare(subs);
854// Start hardware streams 854// Start hardware streams
855// SyncStream first.... 855// SyncStream first....
@@ -869,7 +869,7 @@ static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream)
869 err = usX2Y_urbs_start(subs); 869 err = usX2Y_urbs_start(subs);
870 870
871 up_prepare_mutex: 871 up_prepare_mutex:
872 up(&usX2Y->prepare_mutex); 872 mutex_unlock(&usX2Y->prepare_mutex);
873 return err; 873 return err;
874} 874}
875 875
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c
index 796a7dcef09d..315855082fe1 100644
--- a/sound/usb/usx2y/usx2yhwdeppcm.c
+++ b/sound/usb/usx2y/usx2yhwdeppcm.c
@@ -366,7 +366,7 @@ static int snd_usX2Y_usbpcm_hw_free(struct snd_pcm_substream *substream)
366 struct snd_pcm_runtime *runtime = substream->runtime; 366 struct snd_pcm_runtime *runtime = substream->runtime;
367 struct snd_usX2Y_substream *subs = runtime->private_data, 367 struct snd_usX2Y_substream *subs = runtime->private_data,
368 *cap_subs2 = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; 368 *cap_subs2 = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2];
369 down(&subs->usX2Y->prepare_mutex); 369 mutex_lock(&subs->usX2Y->prepare_mutex);
370 snd_printdd("snd_usX2Y_usbpcm_hw_free(%p)\n", substream); 370 snd_printdd("snd_usX2Y_usbpcm_hw_free(%p)\n", substream);
371 371
372 if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { 372 if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) {
@@ -395,7 +395,7 @@ static int snd_usX2Y_usbpcm_hw_free(struct snd_pcm_substream *substream)
395 usX2Y_usbpcm_urbs_release(cap_subs2); 395 usX2Y_usbpcm_urbs_release(cap_subs2);
396 } 396 }
397 } 397 }
398 up(&subs->usX2Y->prepare_mutex); 398 mutex_unlock(&subs->usX2Y->prepare_mutex);
399 return snd_pcm_lib_free_pages(substream); 399 return snd_pcm_lib_free_pages(substream);
400} 400}
401 401
@@ -503,7 +503,7 @@ static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream)
503 memset(usX2Y->hwdep_pcm_shm, 0, sizeof(struct snd_usX2Y_hwdep_pcm_shm)); 503 memset(usX2Y->hwdep_pcm_shm, 0, sizeof(struct snd_usX2Y_hwdep_pcm_shm));
504 } 504 }
505 505
506 down(&usX2Y->prepare_mutex); 506 mutex_lock(&usX2Y->prepare_mutex);
507 usX2Y_subs_prepare(subs); 507 usX2Y_subs_prepare(subs);
508// Start hardware streams 508// Start hardware streams
509// SyncStream first.... 509// SyncStream first....
@@ -544,7 +544,7 @@ static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream)
544 usX2Y->hwdep_pcm_shm->capture_iso_start = -1; 544 usX2Y->hwdep_pcm_shm->capture_iso_start = -1;
545 545
546 up_prepare_mutex: 546 up_prepare_mutex:
547 up(&usX2Y->prepare_mutex); 547 mutex_unlock(&usX2Y->prepare_mutex);
548 return err; 548 return err;
549} 549}
550 550
@@ -621,7 +621,7 @@ static int usX2Y_pcms_lock_check(struct snd_card *card)
621 if (dev->type != SNDRV_DEV_PCM) 621 if (dev->type != SNDRV_DEV_PCM)
622 continue; 622 continue;
623 pcm = dev->device_data; 623 pcm = dev->device_data;
624 down(&pcm->open_mutex); 624 mutex_lock(&pcm->open_mutex);
625 } 625 }
626 list_for_each(list, &card->devices) { 626 list_for_each(list, &card->devices) {
627 int s; 627 int s;
@@ -650,7 +650,7 @@ static void usX2Y_pcms_unlock(struct snd_card *card)
650 if (dev->type != SNDRV_DEV_PCM) 650 if (dev->type != SNDRV_DEV_PCM)
651 continue; 651 continue;
652 pcm = dev->device_data; 652 pcm = dev->device_data;
653 up(&pcm->open_mutex); 653 mutex_unlock(&pcm->open_mutex);
654 } 654 }
655} 655}
656 656