From 5e4ad2cbffa642ba341f859c7a87df59ea3fd7ac Mon Sep 17 00:00:00 2001 From: riastradh Date: Thu, 22 Sep 2022 14:45:18 +0000 Subject: 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). --- sys/dev/pci/ichsmb.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/pci/ichsmb.c b/sys/dev/pci/ichsmb.c index ac28c603773..08fc243dae2 100644 --- a/sys/dev/pci/ichsmb.c +++ b/sys/dev/pci/ichsmb.c @@ -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 -__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 #include @@ -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; } -- cgit