Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci ichsmb(4): Only rescan i2cbus child if requested.
details: https://anonhg.NetBSD.org/src/rev/ceb133961451
branches: trunk
changeset: 370649:ceb133961451
user: riastradh <riastradh%NetBSD.org@localhost>
date: Thu Sep 22 14:45:18 2022 +0000
description:
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:
sys/dev/pci/ichsmb.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diffs (41 lines):
diff -r 3a8cc8bc17b6 -r ceb133961451 sys/dev/pci/ichsmb.c
--- a/sys/dev/pci/ichsmb.c Thu Sep 22 14:45:01 2022 +0000
+++ b/sys/dev/pci/ichsmb.c Thu Sep 22 14:45:18 2022 +0000
@@ -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 @@
ichsmb_rescan(device_t self, const char *ifattr, const int *locators)
{
struct ichsmb_softc *sc = device_private(self);
- struct i2cbus_attach_args iba;
+
+ if (ifattr_match(ifattr, "i2cbus") && sc->sc_i2c_device == NULL) {
+ struct i2cbus_attach_args iba;
- if (sc->sc_i2c_device != NULL)
- return 0;
-
- 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;
}
Home |
Main Index |
Thread Index |
Old Index