summaryrefslogtreecommitdiffstats
path: root/sound/isa/gus
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-23 23:44:19 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-23 23:44:19 -0500
commit1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch)
treef5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /sound/isa/gus
parentac58c9059da8886b5e8cde012a80266b18ca146e (diff)
parent674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff)
downloadop-kernel-dev-1ebbe2b20091d306453a5cf480a87e6cd28ae76f.zip
op-kernel-dev-1ebbe2b20091d306453a5cf480a87e6cd28ae76f.tar.gz
Merge branch 'linus'
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_pcm.c2
-rw-r--r--sound/isa/gus/gus_synth.c14
-rw-r--r--sound/isa/gus/gusclassic.c4
-rw-r--r--sound/isa/gus/gusextreme.c4
-rw-r--r--sound/isa/gus/gusmax.c4
-rw-r--r--sound/isa/gus/interwave.c4
9 files changed, 32 insertions, 26 deletions
diff --git a/sound/isa/gus/gus_dma.c b/sound/isa/gus/gus_dma.c
index 930f4bc..44ee5d3 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)
int snd_gf1_dma_init(struct snd_gus_card * gus)
{
- down(&gus->dma_mutex);
+ mutex_lock(&gus->dma_mutex);
gus->gf1.dma_shared++;
if (gus->gf1.dma_shared > 1) {
- up(&gus->dma_mutex);
+ mutex_unlock(&gus->dma_mutex);
return 0;
}
gus->gf1.interrupt_handler_dma_write = snd_gf1_dma_interrupt;
@@ -160,7 +160,7 @@ int snd_gf1_dma_init(struct snd_gus_card * gus)
gus->gf1.dma_data_pcm_last =
gus->gf1.dma_data_synth =
gus->gf1.dma_data_synth_last = NULL;
- up(&gus->dma_mutex);
+ mutex_unlock(&gus->dma_mutex);
return 0;
}
@@ -168,7 +168,7 @@ int snd_gf1_dma_done(struct snd_gus_card * gus)
{
struct snd_gf1_dma_block *block;
- down(&gus->dma_mutex);
+ mutex_lock(&gus->dma_mutex);
gus->gf1.dma_shared--;
if (!gus->gf1.dma_shared) {
snd_dma_disable(gus->gf1.dma1);
@@ -185,7 +185,7 @@ int snd_gf1_dma_done(struct snd_gus_card * gus)
gus->gf1.dma_data_pcm_last =
gus->gf1.dma_data_synth_last = NULL;
}
- up(&gus->dma_mutex);
+ mutex_unlock(&gus->dma_mutex);
return 0;
}
diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
index 6d15b3d..53eeaf3 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,
spin_lock_init(&gus->dma_lock);
spin_lock_init(&gus->pcm_volume_level_lock);
spin_lock_init(&gus->uart_cmd_lock);
- init_MUTEX(&gus->dma_mutex);
+ mutex_init(&gus->dma_mutex);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, gus, &ops)) < 0) {
snd_gus_free(gus);
return err;
diff --git a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c
index e8bdb86..3c0d27a 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,
void snd_gf1_mem_lock(struct snd_gf1_mem * alloc, int xup)
{
if (!xup) {
- down(&alloc->memory_mutex);
+ mutex_lock(&alloc->memory_mutex);
} else {
- up(&alloc->memory_mutex);
+ mutex_unlock(&alloc->memory_mutex);
}
}
@@ -59,7 +59,7 @@ static struct snd_gf1_mem_block *snd_gf1_mem_xalloc(struct snd_gf1_mem * alloc,
alloc->first = nblock;
else
nblock->prev->next = nblock;
- up(&alloc->memory_mutex);
+ mutex_unlock(&alloc->memory_mutex);
return NULL;
}
pblock = pblock->next;
@@ -80,7 +80,7 @@ int snd_gf1_mem_xfree(struct snd_gf1_mem * alloc, struct snd_gf1_mem_block * blo
{
if (block->share) { /* ok.. shared block */
block->share--;
- up(&alloc->memory_mutex);
+ mutex_unlock(&alloc->memory_mutex);
return 0;
}
if (alloc->first == block) {
@@ -244,7 +244,7 @@ int snd_gf1_mem_init(struct snd_gus_card * gus)
#endif
alloc = &gus->gf1.mem_alloc;
- init_MUTEX(&alloc->memory_mutex);
+ mutex_init(&alloc->memory_mutex);
alloc->first = alloc->last = NULL;
if (!gus->gf1.memory)
return 0;
@@ -299,7 +299,7 @@ static void snd_gf1_mem_info_read(struct snd_info_entry *entry,
gus = entry->private_data;
alloc = &gus->gf1.mem_alloc;
- down(&alloc->memory_mutex);
+ mutex_lock(&alloc->memory_mutex);
snd_iprintf(buffer, "8-bit banks : \n ");
for (i = 0; i < 4; i++)
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,
}
snd_iprintf(buffer, " Total: memory = %i, used = %i, free = %i\n",
total, used, total - used);
- up(&alloc->memory_mutex);
+ mutex_unlock(&alloc->memory_mutex);
#if 0
ultra_iprintf(buffer, " Verify: free = %i, max 8-bit block = %i, max 16-bit block = %i\n",
ultra_memory_free_size(card, &card->gf1.mem_alloc),
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index d082939..c7f95e7 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -114,8 +114,6 @@ static void snd_gf1_pcm_trigger_up(struct snd_pcm_substream *substream)
unsigned char pan;
unsigned int voice;
- if (substream == NULL)
- return;
spin_lock_irqsave(&pcmp->lock, flags);
if (pcmp->flags & SNDRV_GF1_PCM_PFLG_ACTIVE) {
spin_unlock_irqrestore(&pcmp->lock, flags);
diff --git a/sound/isa/gus/gus_synth.c b/sound/isa/gus/gus_synth.c
index 85a1b05..2767cc1 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 *
if (info->voices > 32)
return -EINVAL;
- down(&gus->register_mutex);
+ mutex_lock(&gus->register_mutex);
if (!snd_gus_use_inc(gus)) {
- up(&gus->register_mutex);
+ mutex_unlock(&gus->register_mutex);
return -EFAULT;
}
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 *
if (voice == NULL) {
snd_gus_synth_free_voices(gus, info->sender.client, info->sender.port);
snd_gus_use_dec(gus);
- up(&gus->register_mutex);
+ mutex_unlock(&gus->register_mutex);
return -EBUSY;
}
voice->index = idx;
}
- up(&gus->register_mutex);
+ mutex_unlock(&gus->register_mutex);
return 0;
}
@@ -79,10 +79,10 @@ static int snd_gus_synth_unuse(void *private_data, struct snd_seq_port_subscribe
struct snd_gus_port * port = private_data;
struct snd_gus_card * gus = port->gus;
- down(&gus->register_mutex);
+ mutex_lock(&gus->register_mutex);
snd_gus_synth_free_voices(gus, info->sender.client, info->sender.port);
snd_gus_use_dec(gus);
- up(&gus->register_mutex);
+ mutex_unlock(&gus->register_mutex);
return 0;
}
@@ -223,7 +223,7 @@ static int snd_gus_synth_new_device(struct snd_seq_device *dev)
if (gus == NULL)
return -EINVAL;
- init_MUTEX(&gus->register_mutex);
+ mutex_init(&gus->register_mutex);
gus->gf1.seq_client = -1;
/* allocate new client */
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index 91c2191..26dccfe 100644
--- a/sound/isa/gus/gusclassic.c
+++ b/sound/isa/gus/gusclassic.c
@@ -247,8 +247,10 @@ static int __init alsa_card_gusclassic_init(void)
return err;
cards = 0;
- for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+ for (i = 0; i < SNDRV_CARDS; i++) {
struct platform_device *device;
+ if (! enable[i])
+ continue;
device = platform_device_register_simple(GUSCLASSIC_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index 239f16e..31dc205 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -357,8 +357,10 @@ static int __init alsa_card_gusextreme_init(void)
return err;
cards = 0;
- for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+ for (i = 0; i < SNDRV_CARDS; i++) {
struct platform_device *device;
+ if (! enable[i])
+ continue;
device = platform_device_register_simple(GUSEXTREME_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index d4d2b2a..cafb9b6 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -384,8 +384,10 @@ static int __init alsa_card_gusmax_init(void)
return err;
cards = 0;
- for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+ for (i = 0; i < SNDRV_CARDS; i++) {
struct platform_device *device;
+ if (! enable[i])
+ continue;
device = platform_device_register_simple(GUSMAX_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 9838d99..2cacd0f 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -935,8 +935,10 @@ static int __init alsa_card_interwave_init(void)
if ((err = platform_driver_register(&snd_interwave_driver)) < 0)
return err;
- for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+ for (i = 0; i < SNDRV_CARDS; i++) {
struct platform_device *device;
+ if (! enable[i])
+ continue;
#ifdef CONFIG_PNP
if (isapnp[i])
continue;
OpenPOWER on IntegriCloud