From 78b2c958ba169ad06e86f5e1725c5ae497a9924d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 2 Mar 2009 10:46:03 +0100 Subject: [PATCH] --- yaml --- r: 133089 b: refs/heads/master c: 6e655bf21697d2594243098a14e0699e8d4a4059 h: refs/heads/master i: 133087: cc8bedac3533b901e6587ac770e182f2c3e93c3f v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/hda_codec.c | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 5416e2a1471b..47c2eda5ad02 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f93d461bcde6ac3db542361c00a7e4167f88176d +refs/heads/master: 6e655bf21697d2594243098a14e0699e8d4a4059 diff --git a/trunk/sound/pci/hda/hda_codec.c b/trunk/sound/pci/hda/hda_codec.c index 1be34ed9c0eb..7c9ef5c18e77 100644 --- a/trunk/sound/pci/hda/hda_codec.c +++ b/trunk/sound/pci/hda/hda_codec.c @@ -2833,8 +2833,16 @@ int snd_hda_codec_build_pcms(struct hda_codec *codec) if (!codec->patch_ops.build_pcms) return 0; err = codec->patch_ops.build_pcms(codec); - if (err < 0) - return err; + if (err < 0) { + printk(KERN_ERR "hda_codec: cannot build PCMs" + "for #%d (error %d)\n", codec->addr, err); + err = snd_hda_codec_reset(codec); + if (err < 0) { + printk(KERN_ERR + "hda_codec: cannot revert codec\n"); + return err; + } + } } for (pcm = 0; pcm < codec->num_pcms; pcm++) { struct hda_pcm *cpcm = &codec->pcm_info[pcm]; @@ -2846,11 +2854,15 @@ int snd_hda_codec_build_pcms(struct hda_codec *codec) if (!cpcm->pcm) { dev = get_empty_pcm_device(codec->bus, cpcm->pcm_type); if (dev < 0) - return 0; + continue; /* no fatal error */ cpcm->device = dev; err = snd_hda_attach_pcm(codec, cpcm); - if (err < 0) - return err; + if (err < 0) { + printk(KERN_ERR "hda_codec: cannot attach " + "PCM stream %d for codec #%d\n", + dev, codec->addr); + continue; /* no fatal error */ + } } } return 0;