aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ca0106/ca_midi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ca0106/ca_midi.c')
-rw-r--r--sound/pci/ca0106/ca_midi.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sound/pci/ca0106/ca_midi.c b/sound/pci/ca0106/ca_midi.c
index 893ee4f..c788511 100644
--- a/sound/pci/ca0106/ca_midi.c
+++ b/sound/pci/ca0106/ca_midi.c
@@ -125,7 +125,8 @@ static int ca_midi_input_open(struct snd_rawmidi_substream *substream)
struct snd_ca_midi *midi = substream->rmidi->private_data;
unsigned long flags;
- snd_assert(midi->dev_id, return -ENXIO);
+ if (snd_BUG_ON(!midi->dev_id))
+ return -ENXIO;
spin_lock_irqsave(&midi->open_lock, flags);
midi->midi_mode |= CA_MIDI_MODE_INPUT;
midi->substream_input = substream;
@@ -144,7 +145,8 @@ static int ca_midi_output_open(struct snd_rawmidi_substream *substream)
struct snd_ca_midi *midi = substream->rmidi->private_data;
unsigned long flags;
- snd_assert(midi->dev_id, return -ENXIO);
+ if (snd_BUG_ON(!midi->dev_id))
+ return -ENXIO;
spin_lock_irqsave(&midi->open_lock, flags);
midi->midi_mode |= CA_MIDI_MODE_OUTPUT;
midi->substream_output = substream;
@@ -163,7 +165,8 @@ static int ca_midi_input_close(struct snd_rawmidi_substream *substream)
struct snd_ca_midi *midi = substream->rmidi->private_data;
unsigned long flags;
- snd_assert(midi->dev_id, return -ENXIO);
+ if (snd_BUG_ON(!midi->dev_id))
+ return -ENXIO;
spin_lock_irqsave(&midi->open_lock, flags);
midi->interrupt_disable(midi,midi->rx_enable);
midi->midi_mode &= ~CA_MIDI_MODE_INPUT;
@@ -181,7 +184,9 @@ static int ca_midi_output_close(struct snd_rawmidi_substream *substream)
{
struct snd_ca_midi *midi = substream->rmidi->private_data;
unsigned long flags;
- snd_assert(midi->dev_id, return -ENXIO);
+
+ if (snd_BUG_ON(!midi->dev_id))
+ return -ENXIO;
spin_lock_irqsave(&midi->open_lock, flags);
@@ -201,7 +206,9 @@ static int ca_midi_output_close(struct snd_rawmidi_substream *substream)
static void ca_midi_input_trigger(struct snd_rawmidi_substream *substream, int up)
{
struct snd_ca_midi *midi = substream->rmidi->private_data;
- snd_assert(midi->dev_id, return);
+
+ if (snd_BUG_ON(!midi->dev_id))
+ return;
if (up) {
midi->interrupt_enable(midi,midi->rx_enable);
@@ -215,7 +222,8 @@ static void ca_midi_output_trigger(struct snd_rawmidi_substream *substream, int
struct snd_ca_midi *midi = substream->rmidi->private_data;
unsigned long flags;
- snd_assert(midi->dev_id, return);
+ if (snd_BUG_ON(!midi->dev_id))
+ return;
if (up) {
int max = 4;