aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-01-16 10:33:08 -0500
committerJaroslav Kysela <perex@suse.cz>2006-03-22 04:25:03 -0500
commit8b7547f95cbe8a5940df62ed730646fdfcba5fda (patch)
tree704102a2b9eaef96cf8b96c46e9e48855de64ea3
parentef9f0a42db987e7e2df72289fb4522d24027786b (diff)
[ALSA] semaphore -> mutex (ISA part)
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/sound/ad1848.h2
-rw-r--r--include/sound/cs4231.h4
-rw-r--r--include/sound/gus.h6
-rw-r--r--include/sound/sb16_csp.h2
-rw-r--r--sound/isa/ad1848/ad1848_lib.c14
-rw-r--r--sound/isa/cs423x/cs4231_lib.c30
-rw-r--r--sound/isa/cs423x/cs4236_lib.c4
-rw-r--r--sound/isa/gus/gus_dma.c10
-rw-r--r--sound/isa/gus/gus_main.c2
-rw-r--r--sound/isa/gus/gus_mem.c14
-rw-r--r--sound/isa/gus/gus_synth.c14
-rw-r--r--sound/isa/sb/sb16_csp.c12
12 files changed, 57 insertions, 57 deletions
diff --git a/include/sound/ad1848.h b/include/sound/ad1848.h
index 1a2759f3a292..57af1fe7b309 100644
--- a/include/sound/ad1848.h
+++ b/include/sound/ad1848.h
@@ -154,7 +154,7 @@ struct snd_ad1848 {
154#endif 154#endif
155 155
156 spinlock_t reg_lock; 156 spinlock_t reg_lock;
157 struct semaphore open_mutex; 157 struct mutex open_mutex;
158}; 158};
159 159
160/* exported functions */ 160/* exported functions */
diff --git a/include/sound/cs4231.h b/include/sound/cs4231.h
index ac6a5d882088..60b5b92a1319 100644
--- a/include/sound/cs4231.h
+++ b/include/sound/cs4231.h
@@ -248,8 +248,8 @@ struct snd_cs4231 {
248 unsigned int c_dma_size; 248 unsigned int c_dma_size;
249 249
250 spinlock_t reg_lock; 250 spinlock_t reg_lock;
251 struct semaphore mce_mutex; 251 struct mutex mce_mutex;
252 struct semaphore open_mutex; 252 struct mutex open_mutex;
253 253
254 int (*rate_constraint) (struct snd_pcm_runtime *runtime); 254 int (*rate_constraint) (struct snd_pcm_runtime *runtime);
255 void (*set_playback_format) (struct snd_cs4231 *chip, struct snd_pcm_hw_params *hw_params, unsigned char pdfr); 255 void (*set_playback_format) (struct snd_cs4231 *chip, struct snd_pcm_hw_params *hw_params, unsigned char pdfr);
diff --git a/include/sound/gus.h b/include/sound/gus.h
index 63da50fae773..68a664ab97f3 100644
--- a/include/sound/gus.h
+++ b/include/sound/gus.h
@@ -209,7 +209,7 @@ struct snd_gf1_mem {
209 struct snd_gf1_bank_info banks_16[4]; 209 struct snd_gf1_bank_info banks_16[4];
210 struct snd_gf1_mem_block *first; 210 struct snd_gf1_mem_block *first;
211 struct snd_gf1_mem_block *last; 211 struct snd_gf1_mem_block *last;
212 struct semaphore memory_mutex; 212 struct mutex memory_mutex;
213}; 213};
214 214
215struct snd_gf1_dma_block { 215struct snd_gf1_dma_block {
@@ -467,8 +467,8 @@ struct snd_gus_card {
467 spinlock_t dma_lock; 467 spinlock_t dma_lock;
468 spinlock_t pcm_volume_level_lock; 468 spinlock_t pcm_volume_level_lock;
469 spinlock_t uart_cmd_lock; 469 spinlock_t uart_cmd_lock;
470 struct semaphore dma_mutex; 470 struct mutex dma_mutex;
471 struct semaphore register_mutex; 471 struct mutex register_mutex;
472}; 472};
473 473
474/* I/O functions for GF1/InterWave chip - gus_io.c */ 474/* I/O functions for GF1/InterWave chip - gus_io.c */
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h
index 3b44d4b370f5..caf6fe21514d 100644
--- a/include/sound/sb16_csp.h
+++ b/include/sound/sb16_csp.h
@@ -158,7 +158,7 @@ struct snd_sb_csp {
158 struct snd_kcontrol *qsound_switch; 158 struct snd_kcontrol *qsound_switch;
159 struct snd_kcontrol *qsound_space; 159 struct snd_kcontrol *qsound_space;
160 160
161 struct semaphore access_mutex; /* locking */ 161 struct mutex access_mutex; /* locking */
162}; 162};
163 163
164int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep); 164int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep);
diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c
index b78530d7ea90..d4b0e580557e 100644
--- a/sound/isa/ad1848/ad1848_lib.c
+++ b/sound/isa/ad1848/ad1848_lib.c
@@ -387,9 +387,9 @@ static int snd_ad1848_open(struct snd_ad1848 *chip, unsigned int mode)
387{ 387{
388 unsigned long flags; 388 unsigned long flags;
389 389
390 down(&chip->open_mutex); 390 mutex_lock(&chip->open_mutex);
391 if (chip->mode & AD1848_MODE_OPEN) { 391 if (chip->mode & AD1848_MODE_OPEN) {
392 up(&chip->open_mutex); 392 mutex_unlock(&chip->open_mutex);
393 return -EAGAIN; 393 return -EAGAIN;
394 } 394 }
395 snd_ad1848_mce_down(chip); 395 snd_ad1848_mce_down(chip);
@@ -432,7 +432,7 @@ static int snd_ad1848_open(struct snd_ad1848 *chip, unsigned int mode)
432 spin_unlock_irqrestore(&chip->reg_lock, flags); 432 spin_unlock_irqrestore(&chip->reg_lock, flags);
433 433
434 chip->mode = mode; 434 chip->mode = mode;
435 up(&chip->open_mutex); 435 mutex_unlock(&chip->open_mutex);
436 436
437 return 0; 437 return 0;
438} 438}
@@ -441,9 +441,9 @@ static void snd_ad1848_close(struct snd_ad1848 *chip)
441{ 441{
442 unsigned long flags; 442 unsigned long flags;
443 443
444 down(&chip->open_mutex); 444 mutex_lock(&chip->open_mutex);
445 if (!chip->mode) { 445 if (!chip->mode) {
446 up(&chip->open_mutex); 446 mutex_unlock(&chip->open_mutex);
447 return; 447 return;
448 } 448 }
449 /* disable IRQ */ 449 /* disable IRQ */
@@ -471,7 +471,7 @@ static void snd_ad1848_close(struct snd_ad1848 *chip)
471 spin_unlock_irqrestore(&chip->reg_lock, flags); 471 spin_unlock_irqrestore(&chip->reg_lock, flags);
472 472
473 chip->mode = 0; 473 chip->mode = 0;
474 up(&chip->open_mutex); 474 mutex_unlock(&chip->open_mutex);
475} 475}
476 476
477/* 477/*
@@ -889,7 +889,7 @@ int snd_ad1848_create(struct snd_card *card,
889 if (chip == NULL) 889 if (chip == NULL)
890 return -ENOMEM; 890 return -ENOMEM;
891 spin_lock_init(&chip->reg_lock); 891 spin_lock_init(&chip->reg_lock);
892 init_MUTEX(&chip->open_mutex); 892 mutex_init(&chip->open_mutex);
893 chip->card = card; 893 chip->card = card;
894 chip->port = port; 894 chip->port = port;
895 chip->irq = -1; 895 chip->irq = -1;
diff --git a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c
index eab7eb59b5f7..823db8246701 100644
--- a/sound/isa/cs423x/cs4231_lib.c
+++ b/sound/isa/cs423x/cs4231_lib.c
@@ -531,7 +531,7 @@ static void snd_cs4231_playback_format(struct snd_cs4231 *chip,
531 unsigned long flags; 531 unsigned long flags;
532 int full_calib = 1; 532 int full_calib = 1;
533 533
534 down(&chip->mce_mutex); 534 mutex_lock(&chip->mce_mutex);
535 snd_cs4231_calibrate_mute(chip, 1); 535 snd_cs4231_calibrate_mute(chip, 1);
536 if (chip->hardware == CS4231_HW_CS4231A || 536 if (chip->hardware == CS4231_HW_CS4231A ||
537 (chip->hardware & CS4231_HW_CS4232_MASK)) { 537 (chip->hardware & CS4231_HW_CS4232_MASK)) {
@@ -560,7 +560,7 @@ static void snd_cs4231_playback_format(struct snd_cs4231 *chip,
560 snd_cs4231_mce_down(chip); 560 snd_cs4231_mce_down(chip);
561 } 561 }
562 snd_cs4231_calibrate_mute(chip, 0); 562 snd_cs4231_calibrate_mute(chip, 0);
563 up(&chip->mce_mutex); 563 mutex_unlock(&chip->mce_mutex);
564} 564}
565 565
566static void snd_cs4231_capture_format(struct snd_cs4231 *chip, 566static void snd_cs4231_capture_format(struct snd_cs4231 *chip,
@@ -570,7 +570,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip,
570 unsigned long flags; 570 unsigned long flags;
571 int full_calib = 1; 571 int full_calib = 1;
572 572
573 down(&chip->mce_mutex); 573 mutex_lock(&chip->mce_mutex);
574 snd_cs4231_calibrate_mute(chip, 1); 574 snd_cs4231_calibrate_mute(chip, 1);
575 if (chip->hardware == CS4231_HW_CS4231A || 575 if (chip->hardware == CS4231_HW_CS4231A ||
576 (chip->hardware & CS4231_HW_CS4232_MASK)) { 576 (chip->hardware & CS4231_HW_CS4232_MASK)) {
@@ -603,7 +603,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip,
603 snd_cs4231_mce_down(chip); 603 snd_cs4231_mce_down(chip);
604 } 604 }
605 snd_cs4231_calibrate_mute(chip, 0); 605 snd_cs4231_calibrate_mute(chip, 0);
606 up(&chip->mce_mutex); 606 mutex_unlock(&chip->mce_mutex);
607} 607}
608 608
609/* 609/*
@@ -709,15 +709,15 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode)
709{ 709{
710 unsigned long flags; 710 unsigned long flags;
711 711
712 down(&chip->open_mutex); 712 mutex_lock(&chip->open_mutex);
713 if ((chip->mode & mode) || 713 if ((chip->mode & mode) ||
714 ((chip->mode & CS4231_MODE_OPEN) && chip->single_dma)) { 714 ((chip->mode & CS4231_MODE_OPEN) && chip->single_dma)) {
715 up(&chip->open_mutex); 715 mutex_unlock(&chip->open_mutex);
716 return -EAGAIN; 716 return -EAGAIN;
717 } 717 }
718 if (chip->mode & CS4231_MODE_OPEN) { 718 if (chip->mode & CS4231_MODE_OPEN) {
719 chip->mode |= mode; 719 chip->mode |= mode;
720 up(&chip->open_mutex); 720 mutex_unlock(&chip->open_mutex);
721 return 0; 721 return 0;
722 } 722 }
723 /* ok. now enable and ack CODEC IRQ */ 723 /* ok. now enable and ack CODEC IRQ */
@@ -737,7 +737,7 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode)
737 spin_unlock_irqrestore(&chip->reg_lock, flags); 737 spin_unlock_irqrestore(&chip->reg_lock, flags);
738 738
739 chip->mode = mode; 739 chip->mode = mode;
740 up(&chip->open_mutex); 740 mutex_unlock(&chip->open_mutex);
741 return 0; 741 return 0;
742} 742}
743 743
@@ -745,10 +745,10 @@ static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode)
745{ 745{
746 unsigned long flags; 746 unsigned long flags;
747 747
748 down(&chip->open_mutex); 748 mutex_lock(&chip->open_mutex);
749 chip->mode &= ~mode; 749 chip->mode &= ~mode;
750 if (chip->mode & CS4231_MODE_OPEN) { 750 if (chip->mode & CS4231_MODE_OPEN) {
751 up(&chip->open_mutex); 751 mutex_unlock(&chip->open_mutex);
752 return; 752 return;
753 } 753 }
754 snd_cs4231_calibrate_mute(chip, 1); 754 snd_cs4231_calibrate_mute(chip, 1);
@@ -785,7 +785,7 @@ static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode)
785 snd_cs4231_calibrate_mute(chip, 0); 785 snd_cs4231_calibrate_mute(chip, 0);
786 786
787 chip->mode = 0; 787 chip->mode = 0;
788 up(&chip->open_mutex); 788 mutex_unlock(&chip->open_mutex);
789} 789}
790 790
791/* 791/*
@@ -1408,8 +1408,8 @@ static int snd_cs4231_new(struct snd_card *card,
1408 chip->hwshare = hwshare; 1408 chip->hwshare = hwshare;
1409 1409
1410 spin_lock_init(&chip->reg_lock); 1410 spin_lock_init(&chip->reg_lock);
1411 init_MUTEX(&chip->mce_mutex); 1411 mutex_init(&chip->mce_mutex);
1412 init_MUTEX(&chip->open_mutex); 1412 mutex_init(&chip->open_mutex);
1413 chip->card = card; 1413 chip->card = card;
1414 chip->rate_constraint = snd_cs4231_xrate; 1414 chip->rate_constraint = snd_cs4231_xrate;
1415 chip->set_playback_format = snd_cs4231_playback_format; 1415 chip->set_playback_format = snd_cs4231_playback_format;
@@ -1538,8 +1538,8 @@ int snd_cs4231_pcm(struct snd_cs4231 *chip, int device, struct snd_pcm **rpcm)
1538 return err; 1538 return err;
1539 1539
1540 spin_lock_init(&chip->reg_lock); 1540 spin_lock_init(&chip->reg_lock);
1541 init_MUTEX(&chip->mce_mutex); 1541 mutex_init(&chip->mce_mutex);
1542 init_MUTEX(&chip->open_mutex); 1542 mutex_init(&chip->open_mutex);
1543 1543
1544 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs4231_playback_ops); 1544 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs4231_playback_ops);
1545 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs4231_capture_ops); 1545 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs4231_capture_ops);
diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c
index e36981d64ec5..1125ddb2b1aa 100644
--- a/sound/isa/cs423x/cs4236_lib.c
+++ b/sound/isa/cs423x/cs4236_lib.c
@@ -841,7 +841,7 @@ static int snd_cs4236_put_iec958_switch(struct snd_kcontrol *kcontrol, struct sn
841 841
842 enable = ucontrol->value.integer.value[0] & 1; 842 enable = ucontrol->value.integer.value[0] & 1;
843 843
844 down(&chip->mce_mutex); 844 mutex_lock(&chip->mce_mutex);
845 snd_cs4231_mce_up(chip); 845 snd_cs4231_mce_up(chip);
846 spin_lock_irqsave(&chip->reg_lock, flags); 846 spin_lock_irqsave(&chip->reg_lock, flags);
847 val = (chip->image[CS4231_ALT_FEATURE_1] & ~0x0e) | (0<<2) | (enable << 1); 847 val = (chip->image[CS4231_ALT_FEATURE_1] & ~0x0e) | (0<<2) | (enable << 1);
@@ -854,7 +854,7 @@ static int snd_cs4236_put_iec958_switch(struct snd_kcontrol *kcontrol, struct sn
854 snd_cs4236_ctrl_out(chip, 4, val); 854 snd_cs4236_ctrl_out(chip, 4, val);
855 spin_unlock_irqrestore(&chip->reg_lock, flags); 855 spin_unlock_irqrestore(&chip->reg_lock, flags);
856 snd_cs4231_mce_down(chip); 856 snd_cs4231_mce_down(chip);
857 up(&chip->mce_mutex); 857 mutex_unlock(&chip->mce_mutex);
858 858
859#if 0 859#if 0
860 printk("set valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n", 860 printk("set valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n",
diff --git a/sound/isa/gus/gus_dma.c b/sound/isa/gus/gus_dma.c
index 930f4bc56f34..44ee5d3674a1 100644
--- a/sound/isa/gus/gus_dma.c
+++ b/sound/isa/gus/gus_dma.c
@@ -149,10 +149,10 @@ static void snd_gf1_dma_interrupt(struct snd_gus_card * gus)
149 149
150int snd_gf1_dma_init(struct snd_gus_card * gus) 150int snd_gf1_dma_init(struct snd_gus_card * gus)
151{ 151{
152 down(&gus->dma_mutex); 152 mutex_lock(&gus->dma_mutex);
153 gus->gf1.dma_shared++; 153 gus->gf1.dma_shared++;
154 if (gus->gf1.dma_shared > 1) { 154 if (gus->gf1.dma_shared > 1) {
155 up(&gus->dma_mutex); 155 mutex_unlock(&gus->dma_mutex);
156 return 0; 156 return 0;
157 } 157 }
158 gus->gf1.interrupt_handler_dma_write = snd_gf1_dma_interrupt; 158 gus->gf1.interrupt_handler_dma_write = snd_gf1_dma_interrupt;
@@ -160,7 +160,7 @@ int snd_gf1_dma_init(struct snd_gus_card * gus)
160 gus->gf1.dma_data_pcm_last = 160 gus->gf1.dma_data_pcm_last =
161 gus->gf1.dma_data_synth = 161 gus->gf1.dma_data_synth =
162 gus->gf1.dma_data_synth_last = NULL; 162 gus->gf1.dma_data_synth_last = NULL;
163 up(&gus->dma_mutex); 163 mutex_unlock(&gus->dma_mutex);
164 return 0; 164 return 0;
165} 165}
166 166
@@ -168,7 +168,7 @@ int snd_gf1_dma_done(struct snd_gus_card * gus)
168{ 168{
169 struct snd_gf1_dma_block *block; 169 struct snd_gf1_dma_block *block;
170 170
171 down(&gus->dma_mutex); 171 mutex_lock(&gus->dma_mutex);
172 gus->gf1.dma_shared--; 172 gus->gf1.dma_shared--;
173 if (!gus->gf1.dma_shared) { 173 if (!gus->gf1.dma_shared) {
174 snd_dma_disable(gus->gf1.dma1); 174 snd_dma_disable(gus->gf1.dma1);
@@ -185,7 +185,7 @@ int snd_gf1_dma_done(struct snd_gus_card * gus)
185 gus->gf1.dma_data_pcm_last = 185 gus->gf1.dma_data_pcm_last =
186 gus->gf1.dma_data_synth_last = NULL; 186 gus->gf1.dma_data_synth_last = NULL;
187 } 187 }
188 up(&gus->dma_mutex); 188 mutex_unlock(&gus->dma_mutex);
189 return 0; 189 return 0;
190} 190}
191 191
diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
index 6d15b3d18a87..53eeaf37007d 100644
--- a/sound/isa/gus/gus_main.c
+++ b/sound/isa/gus/gus_main.c
@@ -225,7 +225,7 @@ int snd_gus_create(struct snd_card *card,
225 spin_lock_init(&gus->dma_lock); 225 spin_lock_init(&gus->dma_lock);
226 spin_lock_init(&gus->pcm_volume_level_lock); 226 spin_lock_init(&gus->pcm_volume_level_lock);
227 spin_lock_init(&gus->uart_cmd_lock); 227 spin_lock_init(&gus->uart_cmd_lock);
228 init_MUTEX(&gus->dma_mutex); 228 mutex_init(&gus->dma_mutex);
229 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, gus, &ops)) < 0) { 229 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, gus, &ops)) < 0) {
230 snd_gus_free(gus); 230 snd_gus_free(gus);
231 return err; 231 return err;
diff --git a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c
index e8bdb860a19f..3c0d27aa08b3 100644
--- a/sound/isa/gus/gus_mem.c
+++ b/sound/isa/gus/gus_mem.c
@@ -34,9 +34,9 @@ static void snd_gf1_mem_info_read(struct snd_info_entry *entry,
34void snd_gf1_mem_lock(struct snd_gf1_mem * alloc, int xup) 34void snd_gf1_mem_lock(struct snd_gf1_mem * alloc, int xup)
35{ 35{
36 if (!xup) { 36 if (!xup) {
37 down(&alloc->memory_mutex); 37 mutex_lock(&alloc->memory_mutex);
38 } else { 38 } else {
39 up(&alloc->memory_mutex); 39 mutex_unlock(&alloc->memory_mutex);
40 } 40 }
41} 41}
42 42
@@ -59,7 +59,7 @@ static struct snd_gf1_mem_block *snd_gf1_mem_xalloc(struct snd_gf1_mem * alloc,
59 alloc->first = nblock; 59 alloc->first = nblock;
60 else 60 else
61 nblock->prev->next = nblock; 61 nblock->prev->next = nblock;
62 up(&alloc->memory_mutex); 62 mutex_unlock(&alloc->memory_mutex);
63 return NULL; 63 return NULL;
64 } 64 }
65 pblock = pblock->next; 65 pblock = pblock->next;
@@ -80,7 +80,7 @@ int snd_gf1_mem_xfree(struct snd_gf1_mem * alloc, struct snd_gf1_mem_block * blo
80{ 80{
81 if (block->share) { /* ok.. shared block */ 81 if (block->share) { /* ok.. shared block */
82 block->share--; 82 block->share--;
83 up(&alloc->memory_mutex); 83 mutex_unlock(&alloc->memory_mutex);
84 return 0; 84 return 0;
85 } 85 }
86 if (alloc->first == block) { 86 if (alloc->first == block) {
@@ -244,7 +244,7 @@ int snd_gf1_mem_init(struct snd_gus_card * gus)
244#endif 244#endif
245 245
246 alloc = &gus->gf1.mem_alloc; 246 alloc = &gus->gf1.mem_alloc;
247 init_MUTEX(&alloc->memory_mutex); 247 mutex_init(&alloc->memory_mutex);
248 alloc->first = alloc->last = NULL; 248 alloc->first = alloc->last = NULL;
249 if (!gus->gf1.memory) 249 if (!gus->gf1.memory)
250 return 0; 250 return 0;
@@ -299,7 +299,7 @@ static void snd_gf1_mem_info_read(struct snd_info_entry *entry,
299 299
300 gus = entry->private_data; 300 gus = entry->private_data;
301 alloc = &gus->gf1.mem_alloc; 301 alloc = &gus->gf1.mem_alloc;
302 down(&alloc->memory_mutex); 302 mutex_lock(&alloc->memory_mutex);
303 snd_iprintf(buffer, "8-bit banks : \n "); 303 snd_iprintf(buffer, "8-bit banks : \n ");
304 for (i = 0; i < 4; i++) 304 for (i = 0; i < 4; i++)
305 snd_iprintf(buffer, "0x%06x (%04ik)%s", alloc->banks_8[i].address, alloc->banks_8[i].size >> 10, i + 1 < 4 ? "," : ""); 305 snd_iprintf(buffer, "0x%06x (%04ik)%s", alloc->banks_8[i].address, alloc->banks_8[i].size >> 10, i + 1 < 4 ? "," : "");
@@ -343,7 +343,7 @@ static void snd_gf1_mem_info_read(struct snd_info_entry *entry,
343 } 343 }
344 snd_iprintf(buffer, " Total: memory = %i, used = %i, free = %i\n", 344 snd_iprintf(buffer, " Total: memory = %i, used = %i, free = %i\n",
345 total, used, total - used); 345 total, used, total - used);
346 up(&alloc->memory_mutex); 346 mutex_unlock(&alloc->memory_mutex);
347#if 0 347#if 0
348 ultra_iprintf(buffer, " Verify: free = %i, max 8-bit block = %i, max 16-bit block = %i\n", 348 ultra_iprintf(buffer, " Verify: free = %i, max 8-bit block = %i, max 16-bit block = %i\n",
349 ultra_memory_free_size(card, &card->gf1.mem_alloc), 349 ultra_memory_free_size(card, &card->gf1.mem_alloc),
diff --git a/sound/isa/gus/gus_synth.c b/sound/isa/gus/gus_synth.c
index 85a1b051f09a..2767cc187ae3 100644
--- a/sound/isa/gus/gus_synth.c
+++ b/sound/isa/gus/gus_synth.c
@@ -55,9 +55,9 @@ static int snd_gus_synth_use(void *private_data, struct snd_seq_port_subscribe *
55 55
56 if (info->voices > 32) 56 if (info->voices > 32)
57 return -EINVAL; 57 return -EINVAL;
58 down(&gus->register_mutex); 58 mutex_lock(&gus->register_mutex);
59 if (!snd_gus_use_inc(gus)) { 59 if (!snd_gus_use_inc(gus)) {
60 up(&gus->register_mutex); 60 mutex_unlock(&gus->register_mutex);
61 return -EFAULT; 61 return -EFAULT;
62 } 62 }
63 for (idx = 0; idx < info->voices; idx++) { 63 for (idx = 0; idx < info->voices; idx++) {
@@ -65,12 +65,12 @@ static int snd_gus_synth_use(void *private_data, struct snd_seq_port_subscribe *
65 if (voice == NULL) { 65 if (voice == NULL) {
66 snd_gus_synth_free_voices(gus, info->sender.client, info->sender.port); 66 snd_gus_synth_free_voices(gus, info->sender.client, info->sender.port);
67 snd_gus_use_dec(gus); 67 snd_gus_use_dec(gus);
68 up(&gus->register_mutex); 68 mutex_unlock(&gus->register_mutex);
69 return -EBUSY; 69 return -EBUSY;
70 } 70 }
71 voice->index = idx; 71 voice->index = idx;
72 } 72 }
73 up(&gus->register_mutex); 73 mutex_unlock(&gus->register_mutex);
74 return 0; 74 return 0;
75} 75}
76 76
@@ -79,10 +79,10 @@ static int snd_gus_synth_unuse(void *private_data, struct snd_seq_port_subscribe
79 struct snd_gus_port * port = private_data; 79 struct snd_gus_port * port = private_data;
80 struct snd_gus_card * gus = port->gus; 80 struct snd_gus_card * gus = port->gus;
81 81
82 down(&gus->register_mutex); 82 mutex_lock(&gus->register_mutex);
83 snd_gus_synth_free_voices(gus, info->sender.client, info->sender.port); 83 snd_gus_synth_free_voices(gus, info->sender.client, info->sender.port);
84 snd_gus_use_dec(gus); 84 snd_gus_use_dec(gus);
85 up(&gus->register_mutex); 85 mutex_unlock(&gus->register_mutex);
86 return 0; 86 return 0;
87} 87}
88 88
@@ -223,7 +223,7 @@ static int snd_gus_synth_new_device(struct snd_seq_device *dev)
223 if (gus == NULL) 223 if (gus == NULL)
224 return -EINVAL; 224 return -EINVAL;
225 225
226 init_MUTEX(&gus->register_mutex); 226 mutex_init(&gus->register_mutex);
227 gus->gf1.seq_client = -1; 227 gus->gf1.seq_client = -1;
228 228
229 /* allocate new client */ 229 /* allocate new client */
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index 9c2b5efbacbf..9703c68e4e08 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -138,7 +138,7 @@ int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep)
138 p->ops.csp_stop = snd_sb_csp_stop; 138 p->ops.csp_stop = snd_sb_csp_stop;
139 p->ops.csp_qsound_transfer = snd_sb_csp_qsound_transfer; 139 p->ops.csp_qsound_transfer = snd_sb_csp_qsound_transfer;
140 140
141 init_MUTEX(&p->access_mutex); 141 mutex_init(&p->access_mutex);
142 sprintf(hw->name, "CSP v%d.%d", (version >> 4), (version & 0x0f)); 142 sprintf(hw->name, "CSP v%d.%d", (version >> 4), (version & 0x0f));
143 hw->iface = SNDRV_HWDEP_IFACE_SB16CSP; 143 hw->iface = SNDRV_HWDEP_IFACE_SB16CSP;
144 hw->private_data = p; 144 hw->private_data = p;
@@ -265,13 +265,13 @@ static int snd_sb_csp_release(struct snd_hwdep * hw, struct file *file)
265 */ 265 */
266static int snd_sb_csp_use(struct snd_sb_csp * p) 266static int snd_sb_csp_use(struct snd_sb_csp * p)
267{ 267{
268 down(&p->access_mutex); 268 mutex_lock(&p->access_mutex);
269 if (p->used) { 269 if (p->used) {
270 up(&p->access_mutex); 270 mutex_unlock(&p->access_mutex);
271 return -EAGAIN; 271 return -EAGAIN;
272 } 272 }
273 p->used++; 273 p->used++;
274 up(&p->access_mutex); 274 mutex_unlock(&p->access_mutex);
275 275
276 return 0; 276 return 0;
277 277
@@ -282,9 +282,9 @@ static int snd_sb_csp_use(struct snd_sb_csp * p)
282 */ 282 */
283static int snd_sb_csp_unuse(struct snd_sb_csp * p) 283static int snd_sb_csp_unuse(struct snd_sb_csp * p)
284{ 284{
285 down(&p->access_mutex); 285 mutex_lock(&p->access_mutex);
286 p->used--; 286 p->used--;
287 up(&p->access_mutex); 287 mutex_unlock(&p->access_mutex);
288 288
289 return 0; 289 return 0;
290} 290}