aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus
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 /sound/isa/gus
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>
Diffstat (limited to 'sound/isa/gus')
-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
4 files changed, 20 insertions, 20 deletions
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 */