]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/drivers/opl4/opl4_seq.c
ALSA: Kill snd_assert() in other places
[linux-2.6-omap-h63xx.git] / sound / drivers / opl4 / opl4_seq.c
index a69117dd0071eb26efeda0170f82f3debf014f97..43d8a2bdd280dc7bdc90e5539a1a9916bf79cba9 100644 (file)
@@ -62,10 +62,10 @@ static int snd_opl4_seq_use(void *private_data, struct snd_seq_port_subscribe *i
        struct snd_opl4 *opl4 = private_data;
        int err;
 
-       down(&opl4->access_mutex);
+       mutex_lock(&opl4->access_mutex);
 
        if (opl4->used) {
-               up(&opl4->access_mutex);
+               mutex_unlock(&opl4->access_mutex);
                return -EBUSY;
        }
        opl4->used++;
@@ -73,12 +73,12 @@ static int snd_opl4_seq_use(void *private_data, struct snd_seq_port_subscribe *i
        if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM) {
                err = snd_opl4_seq_use_inc(opl4);
                if (err < 0) {
-                       up(&opl4->access_mutex);
+                       mutex_unlock(&opl4->access_mutex);
                        return err;
                }
        }
 
-       up(&opl4->access_mutex);
+       mutex_unlock(&opl4->access_mutex);
 
        snd_opl4_synth_reset(opl4);
        return 0;
@@ -90,9 +90,9 @@ static int snd_opl4_seq_unuse(void *private_data, struct snd_seq_port_subscribe
 
        snd_opl4_synth_shutdown(opl4);
 
-       down(&opl4->access_mutex);
+       mutex_lock(&opl4->access_mutex);
        opl4->used--;
-       up(&opl4->access_mutex);
+       mutex_unlock(&opl4->access_mutex);
 
        if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM)
                snd_opl4_seq_use_dec(opl4);
@@ -127,7 +127,6 @@ static int snd_opl4_seq_new_device(struct snd_seq_device *dev)
 {
        struct snd_opl4 *opl4;
        int client;
-       struct snd_seq_client_info cinfo;
        struct snd_seq_port_callback pcallbacks;
 
        opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
@@ -143,7 +142,8 @@ static int snd_opl4_seq_new_device(struct snd_seq_device *dev)
        opl4->chset->private_data = opl4;
 
        /* allocate new client */
-       client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num);
+       client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num,
+                                             "OPL4 Wavetable");
        if (client < 0) {
                snd_midi_channel_free_set(opl4->chset);
                return client;
@@ -151,13 +151,6 @@ static int snd_opl4_seq_new_device(struct snd_seq_device *dev)
        opl4->seq_client = client;
        opl4->chset->client = client;
 
-       /* change name of client */
-       memset(&cinfo, 0, sizeof(cinfo));
-       cinfo.client = client;
-       cinfo.type = KERNEL_CLIENT;
-       strcpy(cinfo.name, "OPL4 Wavetable");
-       snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo);
-
        /* create new port */
        memset(&pcallbacks, 0, sizeof(pcallbacks));
        pcallbacks.owner = THIS_MODULE;
@@ -171,7 +164,9 @@ static int snd_opl4_seq_new_device(struct snd_seq_device *dev)
                                                      SNDRV_SEQ_PORT_CAP_WRITE |
                                                      SNDRV_SEQ_PORT_CAP_SUBS_WRITE,
                                                      SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC |
-                                                     SNDRV_SEQ_PORT_TYPE_MIDI_GM,
+                                                     SNDRV_SEQ_PORT_TYPE_MIDI_GM |
+                                                     SNDRV_SEQ_PORT_TYPE_HARDWARE |
+                                                     SNDRV_SEQ_PORT_TYPE_SYNTHESIZER,
                                                      16, 24,
                                                      "OPL4 Wavetable Port");
        if (opl4->chset->port < 0) {