aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emumpu401.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/emu10k1/emumpu401.c')
-rw-r--r--sound/pci/emu10k1/emumpu401.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sound/pci/emu10k1/emumpu401.c b/sound/pci/emu10k1/emumpu401.c
index c4d76d16661e..8578c70c61f2 100644
--- a/sound/pci/emu10k1/emumpu401.c
+++ b/sound/pci/emu10k1/emumpu401.c
@@ -157,7 +157,8 @@ static int snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream)
157 unsigned long flags; 157 unsigned long flags;
158 158
159 emu = midi->emu; 159 emu = midi->emu;
160 snd_assert(emu, return -ENXIO); 160 if (snd_BUG_ON(!emu))
161 return -ENXIO;
161 spin_lock_irqsave(&midi->open_lock, flags); 162 spin_lock_irqsave(&midi->open_lock, flags);
162 midi->midi_mode |= EMU10K1_MIDI_MODE_INPUT; 163 midi->midi_mode |= EMU10K1_MIDI_MODE_INPUT;
163 midi->substream_input = substream; 164 midi->substream_input = substream;
@@ -183,7 +184,8 @@ static int snd_emu10k1_midi_output_open(struct snd_rawmidi_substream *substream)
183 unsigned long flags; 184 unsigned long flags;
184 185
185 emu = midi->emu; 186 emu = midi->emu;
186 snd_assert(emu, return -ENXIO); 187 if (snd_BUG_ON(!emu))
188 return -ENXIO;
187 spin_lock_irqsave(&midi->open_lock, flags); 189 spin_lock_irqsave(&midi->open_lock, flags);
188 midi->midi_mode |= EMU10K1_MIDI_MODE_OUTPUT; 190 midi->midi_mode |= EMU10K1_MIDI_MODE_OUTPUT;
189 midi->substream_output = substream; 191 midi->substream_output = substream;
@@ -210,7 +212,8 @@ static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream)
210 int err = 0; 212 int err = 0;
211 213
212 emu = midi->emu; 214 emu = midi->emu;
213 snd_assert(emu, return -ENXIO); 215 if (snd_BUG_ON(!emu))
216 return -ENXIO;
214 spin_lock_irqsave(&midi->open_lock, flags); 217 spin_lock_irqsave(&midi->open_lock, flags);
215 snd_emu10k1_intr_disable(emu, midi->rx_enable); 218 snd_emu10k1_intr_disable(emu, midi->rx_enable);
216 midi->midi_mode &= ~EMU10K1_MIDI_MODE_INPUT; 219 midi->midi_mode &= ~EMU10K1_MIDI_MODE_INPUT;
@@ -232,7 +235,8 @@ static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream
232 int err = 0; 235 int err = 0;
233 236
234 emu = midi->emu; 237 emu = midi->emu;
235 snd_assert(emu, return -ENXIO); 238 if (snd_BUG_ON(!emu))
239 return -ENXIO;
236 spin_lock_irqsave(&midi->open_lock, flags); 240 spin_lock_irqsave(&midi->open_lock, flags);
237 snd_emu10k1_intr_disable(emu, midi->tx_enable); 241 snd_emu10k1_intr_disable(emu, midi->tx_enable);
238 midi->midi_mode &= ~EMU10K1_MIDI_MODE_OUTPUT; 242 midi->midi_mode &= ~EMU10K1_MIDI_MODE_OUTPUT;
@@ -251,7 +255,8 @@ static void snd_emu10k1_midi_input_trigger(struct snd_rawmidi_substream *substre
251 struct snd_emu10k1 *emu; 255 struct snd_emu10k1 *emu;
252 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 256 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
253 emu = midi->emu; 257 emu = midi->emu;
254 snd_assert(emu, return); 258 if (snd_BUG_ON(!emu))
259 return;
255 260
256 if (up) 261 if (up)
257 snd_emu10k1_intr_enable(emu, midi->rx_enable); 262 snd_emu10k1_intr_enable(emu, midi->rx_enable);
@@ -266,7 +271,8 @@ static void snd_emu10k1_midi_output_trigger(struct snd_rawmidi_substream *substr
266 unsigned long flags; 271 unsigned long flags;
267 272
268 emu = midi->emu; 273 emu = midi->emu;
269 snd_assert(emu, return); 274 if (snd_BUG_ON(!emu))
275 return;
270 276
271 if (up) { 277 if (up) {
272 int max = 4; 278 int max = 4;