Module Name:    src
Committed By:   riastradh
Date:           Thu Sep 22 14:45:18 UTC 2022

Modified Files:
        src/sys/dev/pci: ichsmb.c

Log Message:
ichsmb(4): Only rescan i2cbus child if requested.

This will let us rescan tcoichbus later too on devices where the TCO
(Intel platform controller hub watchdog timer) hangs off ichsmb(4)
instead of ichlpcib(4).


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/pci/ichsmb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.79 src/sys/dev/pci/ichsmb.c:1.80
--- src/sys/dev/pci/ichsmb.c:1.79	Thu Sep 22 14:45:01 2022
+++ src/sys/dev/pci/ichsmb.c	Thu Sep 22 14:45:18 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.79 2022/09/22 14:45:01 riastradh Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.80 2022/09/22 14:45:18 riastradh Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.79 2022/09/22 14:45:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.80 2022/09/22 14:45:18 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -238,14 +238,15 @@ static int
 ichsmb_rescan(device_t self, const char *ifattr, const int *locators)
 {
 	struct ichsmb_softc *sc = device_private(self);
-	struct i2cbus_attach_args iba;
 
-	if (sc->sc_i2c_device != NULL)
-		return 0;
+	if (ifattr_match(ifattr, "i2cbus") && sc->sc_i2c_device == NULL) {
+		struct i2cbus_attach_args iba;
 
-	memset(&iba, 0, sizeof(iba));
-	iba.iba_tag = &sc->sc_i2c_tag;
-	sc->sc_i2c_device = config_found(self, &iba, iicbus_print, CFARGS_NONE);
+		memset(&iba, 0, sizeof(iba));
+		iba.iba_tag = &sc->sc_i2c_tag;
+		sc->sc_i2c_device = config_found(self, &iba, iicbus_print,
+		    CFARGS_NONE);
+	}
 
 	return 0;
 }

Reply via email to