[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>
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 72fd345..68dc9a2 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -687,6 +687,9 @@
 {
 	int count;
 
+	/* clear STATESTS */
+	azx_writeb(chip, STATESTS, STATESTS_INT_MASK);
+
 	/* reset controller */
 	azx_writel(chip, GCTL, azx_readl(chip, GCTL) & ~ICH6_GCTL_RESET);