diff options
-rw-r--r-- | sound/pci/hda/hda_codec.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 1be34ed9c0eb..7c9ef5c18e77 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -2833,8 +2833,16 @@ int snd_hda_codec_build_pcms(struct hda_codec *codec) | |||
2833 | if (!codec->patch_ops.build_pcms) | 2833 | if (!codec->patch_ops.build_pcms) |
2834 | return 0; | 2834 | return 0; |
2835 | err = codec->patch_ops.build_pcms(codec); | 2835 | err = codec->patch_ops.build_pcms(codec); |
2836 | if (err < 0) | 2836 | if (err < 0) { |
2837 | return err; | 2837 | printk(KERN_ERR "hda_codec: cannot build PCMs" |
2838 | "for #%d (error %d)\n", codec->addr, err); | ||
2839 | err = snd_hda_codec_reset(codec); | ||
2840 | if (err < 0) { | ||
2841 | printk(KERN_ERR | ||
2842 | "hda_codec: cannot revert codec\n"); | ||
2843 | return err; | ||
2844 | } | ||
2845 | } | ||
2838 | } | 2846 | } |
2839 | for (pcm = 0; pcm < codec->num_pcms; pcm++) { | 2847 | for (pcm = 0; pcm < codec->num_pcms; pcm++) { |
2840 | struct hda_pcm *cpcm = &codec->pcm_info[pcm]; | 2848 | struct hda_pcm *cpcm = &codec->pcm_info[pcm]; |
@@ -2846,11 +2854,15 @@ int snd_hda_codec_build_pcms(struct hda_codec *codec) | |||
2846 | if (!cpcm->pcm) { | 2854 | if (!cpcm->pcm) { |
2847 | dev = get_empty_pcm_device(codec->bus, cpcm->pcm_type); | 2855 | dev = get_empty_pcm_device(codec->bus, cpcm->pcm_type); |
2848 | if (dev < 0) | 2856 | if (dev < 0) |
2849 | return 0; | 2857 | continue; /* no fatal error */ |
2850 | cpcm->device = dev; | 2858 | cpcm->device = dev; |
2851 | err = snd_hda_attach_pcm(codec, cpcm); | 2859 | err = snd_hda_attach_pcm(codec, cpcm); |
2852 | if (err < 0) | 2860 | if (err < 0) { |
2853 | return err; | 2861 | printk(KERN_ERR "hda_codec: cannot attach " |
2862 | "PCM stream %d for codec #%d\n", | ||
2863 | dev, codec->addr); | ||
2864 | continue; /* no fatal error */ | ||
2865 | } | ||
2854 | } | 2866 | } |
2855 | } | 2867 | } |
2856 | return 0; | 2868 | return 0; |