NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/51734 (hdaudio errors on boot)



Sorry the previous patch made no sense.

Attached patch is what I intended.

Best regards,

Nat
Index: src/sys/dev/hdaudio/hdaudio.c
===================================================================
RCS file: /cvsroot/src/sys/dev/hdaudio/hdaudio.c,v
retrieving revision 1.5
diff -u -p -r1.5 hdaudio.c
--- src/sys/dev/hdaudio/hdaudio.c	4 Jun 2017 23:34:55 -0000	1.5
+++ src/sys/dev/hdaudio/hdaudio.c	10 Nov 2017 08:43:50 -0000
@@ -156,16 +156,18 @@ hdaudio_init(struct hdaudio_softc *sc)
 static int
 hdaudio_codec_probe(struct hdaudio_softc *sc)
 {
-	uint16_t statests;
+	uint16_t statests, tmpstate = 0;
 	int codecid;
 
 	statests = hda_read2(sc, HDAUDIO_MMIO_STATESTS);
 	for (codecid = 0; codecid < HDAUDIO_MAX_CODECS; codecid++)
-		if (statests & (1 << codecid))
+		if (statests & (1 << codecid)) {
+			tmpstate |= (1 << codecid);
 			sc->sc_codec[codecid].co_valid = true;
+		}
 	hda_write2(sc, HDAUDIO_MMIO_STATESTS, statests);
 
-	return statests;
+	return tmpstate;
 }
 
 int


Home | Main Index | Thread Index | Old Index