]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/synth/emux/emux_seq.c
ALSA: Kill snd_assert() in other places
[linux-2.6-omap-h63xx.git] / sound / synth / emux / emux_seq.c
index 1a973d7a90f8a302fd453f9c808597a9a41dd75f..335aa2ce257427dc44a8af0f33021a1c9064b9c0 100644 (file)
@@ -55,7 +55,8 @@ static struct snd_midi_op emux_ops = {
                                 SNDRV_SEQ_PORT_TYPE_MIDI_GM |\
                                 SNDRV_SEQ_PORT_TYPE_MIDI_GS |\
                                 SNDRV_SEQ_PORT_TYPE_MIDI_XG |\
-                                SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE)
+                                SNDRV_SEQ_PORT_TYPE_HARDWARE |\
+                                SNDRV_SEQ_PORT_TYPE_SYNTHESIZER)
 
 /*
  * Initialise the EMUX Synth by creating a client and registering
@@ -123,12 +124,12 @@ snd_emux_detach_seq(struct snd_emux *emu)
        if (emu->voices)
                snd_emux_terminate_all(emu);
                
-       down(&emu->register_mutex);
+       mutex_lock(&emu->register_mutex);
        if (emu->client >= 0) {
                snd_seq_delete_kernel_client(emu->client);
                emu->client = -1;
        }
-       up(&emu->register_mutex);
+       mutex_unlock(&emu->register_mutex);
 }
 
 
@@ -256,7 +257,8 @@ snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private_data,
        struct snd_emux_port *port;
 
        port = private_data;
-       snd_assert(port != NULL && ev != NULL, return -EINVAL);
+       if (snd_BUG_ON(!port || !ev))
+               return -EINVAL;
 
        snd_midi_process_event(&emux_ops, ev, &port->chset);
 
@@ -307,14 +309,16 @@ snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info)
        struct snd_emux *emu;
 
        p = private_data;
-       snd_assert(p != NULL, return -EINVAL);
+       if (snd_BUG_ON(!p))
+               return -EINVAL;
        emu = p->emu;
-       snd_assert(emu != NULL, return -EINVAL);
+       if (snd_BUG_ON(!emu))
+               return -EINVAL;
 
-       down(&emu->register_mutex);
+       mutex_lock(&emu->register_mutex);
        snd_emux_init_port(p);
        snd_emux_inc_count(emu);
-       up(&emu->register_mutex);
+       mutex_unlock(&emu->register_mutex);
        return 0;
 }
 
@@ -328,14 +332,16 @@ snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info)
        struct snd_emux *emu;
 
        p = private_data;
-       snd_assert(p != NULL, return -EINVAL);
+       if (snd_BUG_ON(!p))
+               return -EINVAL;
        emu = p->emu;
-       snd_assert(emu != NULL, return -EINVAL);
+       if (snd_BUG_ON(!emu))
+               return -EINVAL;
 
-       down(&emu->register_mutex);
+       mutex_lock(&emu->register_mutex);
        snd_emux_sounds_off_all(p);
        snd_emux_dec_count(emu);
-       up(&emu->register_mutex);
+       mutex_unlock(&emu->register_mutex);
        return 0;
 }