diff options
Diffstat (limited to 'sound/isa/wavefront/wavefront_midi.c')
-rw-r--r-- | sound/isa/wavefront/wavefront_midi.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/sound/isa/wavefront/wavefront_midi.c b/sound/isa/wavefront/wavefront_midi.c index a33384a55b0f..f14a7c0b6998 100644 --- a/sound/isa/wavefront/wavefront_midi.c +++ b/sound/isa/wavefront/wavefront_midi.c | |||
@@ -235,8 +235,10 @@ static int snd_wavefront_midi_input_open(struct snd_rawmidi_substream *substream | |||
235 | snd_wavefront_midi_t *midi; | 235 | snd_wavefront_midi_t *midi; |
236 | snd_wavefront_mpu_id mpu; | 236 | snd_wavefront_mpu_id mpu; |
237 | 237 | ||
238 | snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); | 238 | if (snd_BUG_ON(!substream || !substream->rmidi)) |
239 | snd_assert(substream->rmidi->private_data != NULL, return -EIO); | 239 | return -ENXIO; |
240 | if (snd_BUG_ON(!substream->rmidi->private_data)) | ||
241 | return -ENXIO; | ||
240 | 242 | ||
241 | mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); | 243 | mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); |
242 | 244 | ||
@@ -257,8 +259,10 @@ static int snd_wavefront_midi_output_open(struct snd_rawmidi_substream *substrea | |||
257 | snd_wavefront_midi_t *midi; | 259 | snd_wavefront_midi_t *midi; |
258 | snd_wavefront_mpu_id mpu; | 260 | snd_wavefront_mpu_id mpu; |
259 | 261 | ||
260 | snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); | 262 | if (snd_BUG_ON(!substream || !substream->rmidi)) |
261 | snd_assert(substream->rmidi->private_data != NULL, return -EIO); | 263 | return -ENXIO; |
264 | if (snd_BUG_ON(!substream->rmidi->private_data)) | ||
265 | return -ENXIO; | ||
262 | 266 | ||
263 | mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); | 267 | mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); |
264 | 268 | ||
@@ -279,8 +283,10 @@ static int snd_wavefront_midi_input_close(struct snd_rawmidi_substream *substrea | |||
279 | snd_wavefront_midi_t *midi; | 283 | snd_wavefront_midi_t *midi; |
280 | snd_wavefront_mpu_id mpu; | 284 | snd_wavefront_mpu_id mpu; |
281 | 285 | ||
282 | snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); | 286 | if (snd_BUG_ON(!substream || !substream->rmidi)) |
283 | snd_assert(substream->rmidi->private_data != NULL, return -EIO); | 287 | return -ENXIO; |
288 | if (snd_BUG_ON(!substream->rmidi->private_data)) | ||
289 | return -ENXIO; | ||
284 | 290 | ||
285 | mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); | 291 | mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); |
286 | 292 | ||
@@ -300,8 +306,10 @@ static int snd_wavefront_midi_output_close(struct snd_rawmidi_substream *substre | |||
300 | snd_wavefront_midi_t *midi; | 306 | snd_wavefront_midi_t *midi; |
301 | snd_wavefront_mpu_id mpu; | 307 | snd_wavefront_mpu_id mpu; |
302 | 308 | ||
303 | snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); | 309 | if (snd_BUG_ON(!substream || !substream->rmidi)) |
304 | snd_assert(substream->rmidi->private_data != NULL, return -EIO); | 310 | return -ENXIO; |
311 | if (snd_BUG_ON(!substream->rmidi->private_data)) | ||
312 | return -ENXIO; | ||
305 | 313 | ||
306 | mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); | 314 | mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); |
307 | 315 | ||