summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-09-22 14:45:18 +0000
committerriastradh <riastradh@NetBSD.org>2022-09-22 14:45:18 +0000
commit5e4ad2cbffa642ba341f859c7a87df59ea3fd7ac (patch)
treeb0b4963d7c7d158eb2d123f3313be2f39eb2cde0 /sys/dev
parentd8ba466bf6f68145d250cb1aa2337475db66ae79 (diff)
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).
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/ichsmb.c17
1 files changed, 9 insertions, 8 deletions
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 <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;
}