diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 17:44:01 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 12:28:58 +0100 |
commit | 73e77ba0235532bd7523ba90883d325f6e095acf (patch) | |
tree | d22f29805ade9e78bd5f1802590d42f6e121c3c1 /sound/core/rawmidi.c | |
parent | 00a4e3d9f8df8a90966b75d517154718b4a2242a (diff) | |
download | op-kernel-dev-73e77ba0235532bd7523ba90883d325f6e095acf.zip op-kernel-dev-73e77ba0235532bd7523ba90883d325f6e095acf.tar.gz |
[ALSA] Add error messages
Add error messages in the critial error path to be more verbose.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/rawmidi.c')
-rw-r--r-- | sound/core/rawmidi.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index ede0a60..7a86a9a 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -1382,8 +1382,10 @@ static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi, INIT_LIST_HEAD(&stream->substreams); for (idx = 0; idx < count; idx++) { substream = kzalloc(sizeof(*substream), GFP_KERNEL); - if (substream == NULL) + if (substream == NULL) { + snd_printk(KERN_ERR "rawmidi: cannot allocate substream\n"); return -ENOMEM; + } substream->stream = direction; substream->number = idx; substream->rmidi = rmidi; @@ -1425,19 +1427,27 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device, *rrawmidi = NULL; snd_assert(card != NULL, return -ENXIO); rmidi = kzalloc(sizeof(*rmidi), GFP_KERNEL); - if (rmidi == NULL) + if (rmidi == NULL) { + snd_printk(KERN_ERR "rawmidi: cannot allocate\n"); return -ENOMEM; + } rmidi->card = card; rmidi->device = device; init_MUTEX(&rmidi->open_mutex); init_waitqueue_head(&rmidi->open_wait); if (id != NULL) strlcpy(rmidi->id, id, sizeof(rmidi->id)); - if ((err = snd_rawmidi_alloc_substreams(rmidi, &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT], SNDRV_RAWMIDI_STREAM_INPUT, input_count)) < 0) { + if ((err = snd_rawmidi_alloc_substreams(rmidi, + &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT], + SNDRV_RAWMIDI_STREAM_INPUT, + input_count)) < 0) { snd_rawmidi_free(rmidi); return err; } - if ((err = snd_rawmidi_alloc_substreams(rmidi, &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT], SNDRV_RAWMIDI_STREAM_OUTPUT, output_count)) < 0) { + if ((err = snd_rawmidi_alloc_substreams(rmidi, + &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT], + SNDRV_RAWMIDI_STREAM_OUTPUT, + output_count)) < 0) { snd_rawmidi_free(rmidi); return err; } |