aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emu10k1x.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/emu10k1/emu10k1x.c')
-rw-r--r--sound/pci/emu10k1/emu10k1x.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 491a4a50f86..5ff4dbb62da 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -1319,7 +1319,8 @@ static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream)
1319 unsigned long flags; 1319 unsigned long flags;
1320 1320
1321 emu = midi->emu; 1321 emu = midi->emu;
1322 snd_assert(emu, return -ENXIO); 1322 if (snd_BUG_ON(!emu))
1323 return -ENXIO;
1323 spin_lock_irqsave(&midi->open_lock, flags); 1324 spin_lock_irqsave(&midi->open_lock, flags);
1324 midi->midi_mode |= EMU10K1X_MIDI_MODE_INPUT; 1325 midi->midi_mode |= EMU10K1X_MIDI_MODE_INPUT;
1325 midi->substream_input = substream; 1326 midi->substream_input = substream;
@@ -1345,7 +1346,8 @@ static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream
1345 unsigned long flags; 1346 unsigned long flags;
1346 1347
1347 emu = midi->emu; 1348 emu = midi->emu;
1348 snd_assert(emu, return -ENXIO); 1349 if (snd_BUG_ON(!emu))
1350 return -ENXIO;
1349 spin_lock_irqsave(&midi->open_lock, flags); 1351 spin_lock_irqsave(&midi->open_lock, flags);
1350 midi->midi_mode |= EMU10K1X_MIDI_MODE_OUTPUT; 1352 midi->midi_mode |= EMU10K1X_MIDI_MODE_OUTPUT;
1351 midi->substream_output = substream; 1353 midi->substream_output = substream;
@@ -1372,7 +1374,8 @@ static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream
1372 int err = 0; 1374 int err = 0;
1373 1375
1374 emu = midi->emu; 1376 emu = midi->emu;
1375 snd_assert(emu, return -ENXIO); 1377 if (snd_BUG_ON(!emu))
1378 return -ENXIO;
1376 spin_lock_irqsave(&midi->open_lock, flags); 1379 spin_lock_irqsave(&midi->open_lock, flags);
1377 snd_emu10k1x_intr_disable(emu, midi->rx_enable); 1380 snd_emu10k1x_intr_disable(emu, midi->rx_enable);
1378 midi->midi_mode &= ~EMU10K1X_MIDI_MODE_INPUT; 1381 midi->midi_mode &= ~EMU10K1X_MIDI_MODE_INPUT;
@@ -1394,7 +1397,8 @@ static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substrea
1394 int err = 0; 1397 int err = 0;
1395 1398
1396 emu = midi->emu; 1399 emu = midi->emu;
1397 snd_assert(emu, return -ENXIO); 1400 if (snd_BUG_ON(!emu))
1401 return -ENXIO;
1398 spin_lock_irqsave(&midi->open_lock, flags); 1402 spin_lock_irqsave(&midi->open_lock, flags);
1399 snd_emu10k1x_intr_disable(emu, midi->tx_enable); 1403 snd_emu10k1x_intr_disable(emu, midi->tx_enable);
1400 midi->midi_mode &= ~EMU10K1X_MIDI_MODE_OUTPUT; 1404 midi->midi_mode &= ~EMU10K1X_MIDI_MODE_OUTPUT;
@@ -1413,7 +1417,8 @@ static void snd_emu10k1x_midi_input_trigger(struct snd_rawmidi_substream *substr
1413 struct emu10k1x *emu; 1417 struct emu10k1x *emu;
1414 struct emu10k1x_midi *midi = substream->rmidi->private_data; 1418 struct emu10k1x_midi *midi = substream->rmidi->private_data;
1415 emu = midi->emu; 1419 emu = midi->emu;
1416 snd_assert(emu, return); 1420 if (snd_BUG_ON(!emu))
1421 return;
1417 1422
1418 if (up) 1423 if (up)
1419 snd_emu10k1x_intr_enable(emu, midi->rx_enable); 1424 snd_emu10k1x_intr_enable(emu, midi->rx_enable);
@@ -1428,7 +1433,8 @@ static void snd_emu10k1x_midi_output_trigger(struct snd_rawmidi_substream *subst
1428 unsigned long flags; 1433 unsigned long flags;
1429 1434
1430 emu = midi->emu; 1435 emu = midi->emu;
1431 snd_assert(emu, return); 1436 if (snd_BUG_ON(!emu))
1437 return;
1432 1438
1433 if (up) { 1439 if (up) {
1434 int max = 4; 1440 int max = 4;