aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-02 04:44:15 -0500
committerTakashi Iwai <tiwai@suse.de>2009-03-02 04:44:15 -0500
commitf93d461bcde6ac3db542361c00a7e4167f88176d (patch)
treeb4a64791fc78adbce9f245093bf802f43094c1d6 /sound/pci/hda/hda_codec.c
parentd1f1af2dbf8207db590853a59bec465c4f68cfdc (diff)
ALSA: hda - Revert the codec probe at control-creation errors
Revert the codec probe instead of returning the error to the driver when any error occurs at creating the control elements. The control element conflict can be non-fatal in many cases, especially if it comes from the digital-only codec. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 3b44c789f23b..1be34ed9c0eb 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1434,7 +1434,6 @@ int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl)
1434} 1434}
1435EXPORT_SYMBOL_HDA(snd_hda_ctl_add); 1435EXPORT_SYMBOL_HDA(snd_hda_ctl_add);
1436 1436
1437#ifdef CONFIG_SND_HDA_RECONFIG
1438/* Clear all controls assigned to the given codec */ 1437/* Clear all controls assigned to the given codec */
1439void snd_hda_ctls_clear(struct hda_codec *codec) 1438void snd_hda_ctls_clear(struct hda_codec *codec)
1440{ 1439{
@@ -1529,7 +1528,6 @@ int snd_hda_codec_reset(struct hda_codec *codec)
1529 hda_unlock_devices(card); 1528 hda_unlock_devices(card);
1530 return 0; 1529 return 0;
1531} 1530}
1532#endif /* CONFIG_SND_HDA_RECONFIG */
1533 1531
1534/* create a virtual master control and add slaves */ 1532/* create a virtual master control and add slaves */
1535int snd_hda_add_vmaster(struct hda_codec *codec, char *name, 1533int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
@@ -2392,8 +2390,16 @@ int /*__devinit*/ snd_hda_build_controls(struct hda_bus *bus)
2392 2390
2393 list_for_each_entry(codec, &bus->codec_list, list) { 2391 list_for_each_entry(codec, &bus->codec_list, list) {
2394 int err = snd_hda_codec_build_controls(codec); 2392 int err = snd_hda_codec_build_controls(codec);
2395 if (err < 0) 2393 if (err < 0) {
2396 return err; 2394 printk(KERN_ERR "hda_codec: cannot build controls"
2395 "for #%d (error %d)\n", codec->addr, err);
2396 err = snd_hda_codec_reset(codec);
2397 if (err < 0) {
2398 printk(KERN_ERR
2399 "hda_codec: cannot revert codec\n");
2400 return err;
2401 }
2402 }
2397 } 2403 }
2398 return 0; 2404 return 0;
2399} 2405}