]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/emu10k1/emumpu401.c
ALSA: Kill snd_assert() in sound/pci/*
[linux-2.6-omap-h63xx.git] / sound / pci / emu10k1 / emumpu401.c
index c4d76d16661eed2d5af5a49ec51e81cb22cef45c..8578c70c61f2b4ee15a7583c47641bd2405d4e78 100644 (file)
@@ -157,7 +157,8 @@ static int snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream)
        unsigned long flags;
 
        emu = midi->emu;
-       snd_assert(emu, return -ENXIO);
+       if (snd_BUG_ON(!emu))
+               return -ENXIO;
        spin_lock_irqsave(&midi->open_lock, flags);
        midi->midi_mode |= EMU10K1_MIDI_MODE_INPUT;
        midi->substream_input = substream;
@@ -183,7 +184,8 @@ static int snd_emu10k1_midi_output_open(struct snd_rawmidi_substream *substream)
        unsigned long flags;
 
        emu = midi->emu;
-       snd_assert(emu, return -ENXIO);
+       if (snd_BUG_ON(!emu))
+               return -ENXIO;
        spin_lock_irqsave(&midi->open_lock, flags);
        midi->midi_mode |= EMU10K1_MIDI_MODE_OUTPUT;
        midi->substream_output = substream;
@@ -210,7 +212,8 @@ static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream)
        int err = 0;
 
        emu = midi->emu;
-       snd_assert(emu, return -ENXIO);
+       if (snd_BUG_ON(!emu))
+               return -ENXIO;
        spin_lock_irqsave(&midi->open_lock, flags);
        snd_emu10k1_intr_disable(emu, midi->rx_enable);
        midi->midi_mode &= ~EMU10K1_MIDI_MODE_INPUT;
@@ -232,7 +235,8 @@ static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream
        int err = 0;
 
        emu = midi->emu;
-       snd_assert(emu, return -ENXIO);
+       if (snd_BUG_ON(!emu))
+               return -ENXIO;
        spin_lock_irqsave(&midi->open_lock, flags);
        snd_emu10k1_intr_disable(emu, midi->tx_enable);
        midi->midi_mode &= ~EMU10K1_MIDI_MODE_OUTPUT;
@@ -251,7 +255,8 @@ static void snd_emu10k1_midi_input_trigger(struct snd_rawmidi_substream *substre
        struct snd_emu10k1 *emu;
        struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
        emu = midi->emu;
-       snd_assert(emu, return);
+       if (snd_BUG_ON(!emu))
+               return;
 
        if (up)
                snd_emu10k1_intr_enable(emu, midi->rx_enable);
@@ -266,7 +271,8 @@ static void snd_emu10k1_midi_output_trigger(struct snd_rawmidi_substream *substr
        unsigned long flags;
 
        emu = midi->emu;
-       snd_assert(emu, return);
+       if (snd_BUG_ON(!emu))
+               return;
 
        if (up) {
                int max = 4;