]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/isa/gus/gus_synth.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6-omap-h63xx.git] / sound / isa / gus / gus_synth.c
index 6464488363e4f9485ea809559a845b59cf0f67a1..3e4d4d6edd8b50cda1ec9d3100638475f192fcbc 100644 (file)
@@ -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;
 }
 
@@ -194,7 +194,9 @@ static int snd_gus_synth_create_port(struct snd_gus_card * gus, int idx)
                                                   &callbacks,
                                                   SNDRV_SEQ_PORT_CAP_WRITE | SNDRV_SEQ_PORT_CAP_SUBS_WRITE,
                                                   SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE |
-                                                  SNDRV_SEQ_PORT_TYPE_SYNTH,
+                                                  SNDRV_SEQ_PORT_TYPE_SYNTH |
+                                                  SNDRV_SEQ_PORT_TYPE_HARDWARE |
+                                                  SNDRV_SEQ_PORT_TYPE_SYNTHESIZER,
                                                   16, 0,
                                                   name);
        if (p->chset->port < 0) {
@@ -214,7 +216,6 @@ static int snd_gus_synth_new_device(struct snd_seq_device *dev)
 {
        struct snd_gus_card *gus;
        int client, i;
-       struct snd_seq_client_info *cinfo;
        struct snd_seq_port_subscribe sub;
        struct snd_iwffff_ops *iwops;
        struct snd_gf1_ops *gf1ops;
@@ -224,28 +225,15 @@ 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;
        
-       cinfo = kmalloc(sizeof(*cinfo), GFP_KERNEL);
-       if (! cinfo)
-               return -ENOMEM;
-
        /* allocate new client */
        client = gus->gf1.seq_client =
-               snd_seq_create_kernel_client(gus->card, 1);
-       if (client < 0) {
-               kfree(cinfo);
+               snd_seq_create_kernel_client(gus->card, 1, gus->interwave ?
+                                            "AMD InterWave" : "GF1");
+       if (client < 0)
                return client;
-       }
-
-       /* change name of client */
-       memset(cinfo, 0, sizeof(*cinfo));
-       cinfo->client = client;
-       cinfo->type = KERNEL_CLIENT;
-       sprintf(cinfo->name, gus->interwave ? "AMD InterWave" : "GF1");
-       snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, cinfo);
-       kfree(cinfo);
 
        for (i = 0; i < 4; i++)
                snd_gus_synth_create_port(gus, i);