From e8a7f136f5edb6ae83b14faaa0da2a3c4558f431 Mon Sep 17 00:00:00 2001 From: Danny Tholen Date: Tue, 11 Sep 2007 21:41:56 +0200 Subject: [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 Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/pci/hda/hda_codec.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/pci/hda/hda_codec.c') 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, unsigned int parm; parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT); + if (parm == -1) + return 0; *start_id = (parm >> 16) & 0x7fff; return (int)(parm & 0x7fff); } -- cgit v1.2.3-55-g7522