diff options
author | Danny Tholen <obiwan@mailmij.org> | 2007-09-11 15:41:56 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 10:50:20 -0400 |
commit | e8a7f136f5edb6ae83b14faaa0da2a3c4558f431 (patch) | |
tree | bb8d5c873e8c993f8c97aad06e73c45e217b5d6b /sound/pci/hda/hda_codec.c | |
parent | 768d8c7df886fc5cc9d6057cc987ef8e52d197b5 (diff) |
[ALSA] hda-intel - Improve HD-audio codec probing robustness
When modem is disabled in the BIOS, detection of the number of codecs
always fails after booting if STATESTS is not cleared first.
This patch fixes this problem and also adds an error check in a place
where a read error would lead to a very large number of pointless loops.
Signed-off-by: Danny Tholen <obiwan@mailmij.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index e594de0b153e..535bcb7601b5 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -155,6 +155,8 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, | |||
155 | unsigned int parm; | 155 | unsigned int parm; |
156 | 156 | ||
157 | parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT); | 157 | parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT); |
158 | if (parm == -1) | ||
159 | return 0; | ||
158 | *start_id = (parm >> 16) & 0x7fff; | 160 | *start_id = (parm >> 16) & 0x7fff; |
159 | return (int)(parm & 0x7fff); | 161 | return (int)(parm & 0x7fff); |
160 | } | 162 | } |