-/* $OpenBSD: mainbus.c,v 1.25 2023/05/19 21:15:16 patrick Exp $ */
+/* $OpenBSD: mainbus.c,v 1.26 2023/07/19 20:26:11 kettenis Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org>
mainbus_attach_apm(self);
/* Scan the whole tree. */
- sc->sc_early = 1;
- for (node = OF_child(sc->sc_node); node != 0; node = OF_peer(node))
- mainbus_attach_node(self, node, NULL);
-
- sc->sc_early = 0;
- for (node = OF_child(sc->sc_node); node != 0; node = OF_peer(node))
- mainbus_attach_node(self, node, NULL);
+ for (sc->sc_early = 2; sc->sc_early >= 0; sc->sc_early--) {
+ for (node = OF_child(sc->sc_node); node; node = OF_peer(node))
+ mainbus_attach_node(self, node, NULL);
+ }
mainbus_attach_framebuffer(self);
-/* $OpenBSD: simplebus.c,v 1.16 2022/11/06 12:01:52 patrick Exp $ */
+/* $OpenBSD: simplebus.c,v 1.17 2023/07/19 20:26:11 kettenis Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
*
}
/* Scan the whole tree. */
- sc->sc_early = 1;
- for (node = OF_child(sc->sc_node); node; node = OF_peer(node))
- simplebus_attach_node(self, node);
-
- sc->sc_early = 0;
- for (node = OF_child(sc->sc_node); node; node = OF_peer(node))
- simplebus_attach_node(self, node);
+ for (sc->sc_early = 2; sc->sc_early >= 0; sc->sc_early--) {
+ for (node = OF_child(sc->sc_node); node; node = OF_peer(node))
+ simplebus_attach_node(self, node);
+ }
}
int