diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 11:44:01 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:28:58 -0500 |
commit | 73e77ba0235532bd7523ba90883d325f6e095acf (patch) | |
tree | d22f29805ade9e78bd5f1802590d42f6e121c3c1 /sound/core/pcm.c | |
parent | 00a4e3d9f8df8a90966b75d517154718b4a2242a (diff) |
[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/pcm.c')
-rw-r--r-- | sound/core/pcm.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 59c995bbf15b..9305ac357a3e 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
@@ -600,14 +600,18 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) | |||
600 | pstr->reg = &snd_pcm_reg[stream]; | 600 | pstr->reg = &snd_pcm_reg[stream]; |
601 | if (substream_count > 0) { | 601 | if (substream_count > 0) { |
602 | err = snd_pcm_stream_proc_init(pstr); | 602 | err = snd_pcm_stream_proc_init(pstr); |
603 | if (err < 0) | 603 | if (err < 0) { |
604 | snd_printk(KERN_ERR "Error in snd_pcm_stream_proc_init\n"); | ||
604 | return err; | 605 | return err; |
606 | } | ||
605 | } | 607 | } |
606 | prev = NULL; | 608 | prev = NULL; |
607 | for (idx = 0, prev = NULL; idx < substream_count; idx++) { | 609 | for (idx = 0, prev = NULL; idx < substream_count; idx++) { |
608 | substream = kzalloc(sizeof(*substream), GFP_KERNEL); | 610 | substream = kzalloc(sizeof(*substream), GFP_KERNEL); |
609 | if (substream == NULL) | 611 | if (substream == NULL) { |
612 | snd_printk(KERN_ERR "Cannot allocate PCM substream\n"); | ||
610 | return -ENOMEM; | 613 | return -ENOMEM; |
614 | } | ||
611 | substream->pcm = pcm; | 615 | substream->pcm = pcm; |
612 | substream->pstr = pstr; | 616 | substream->pstr = pstr; |
613 | substream->number = idx; | 617 | substream->number = idx; |
@@ -620,6 +624,7 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) | |||
620 | prev->next = substream; | 624 | prev->next = substream; |
621 | err = snd_pcm_substream_proc_init(substream); | 625 | err = snd_pcm_substream_proc_init(substream); |
622 | if (err < 0) { | 626 | if (err < 0) { |
627 | snd_printk(KERN_ERR "Error in snd_pcm_stream_proc_init\n"); | ||
623 | kfree(substream); | 628 | kfree(substream); |
624 | return err; | 629 | return err; |
625 | } | 630 | } |
@@ -666,13 +671,14 @@ int snd_pcm_new(struct snd_card *card, char *id, int device, | |||
666 | *rpcm = NULL; | 671 | *rpcm = NULL; |
667 | snd_assert(card != NULL, return -ENXIO); | 672 | snd_assert(card != NULL, return -ENXIO); |
668 | pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); | 673 | pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); |
669 | if (pcm == NULL) | 674 | if (pcm == NULL) { |
675 | snd_printk(KERN_ERR "Cannot allocate PCM\n"); | ||
670 | return -ENOMEM; | 676 | return -ENOMEM; |
677 | } | ||
671 | pcm->card = card; | 678 | pcm->card = card; |
672 | pcm->device = device; | 679 | pcm->device = device; |
673 | if (id) { | 680 | if (id) |
674 | strlcpy(pcm->id, id, sizeof(pcm->id)); | 681 | strlcpy(pcm->id, id, sizeof(pcm->id)); |
675 | } | ||
676 | if ((err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_PLAYBACK, playback_count)) < 0) { | 682 | if ((err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_PLAYBACK, playback_count)) < 0) { |
677 | snd_pcm_free(pcm); | 683 | snd_pcm_free(pcm); |
678 | return err; | 684 | return err; |