summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2014-03-13 03:52:57 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2014-03-13 03:52:57 +0000
commitddb81f81c6b53bdfc4bba2ced060724d2beb0270 (patch)
tree84af82316dccb1276e4f2db46dffa3136279a846 /sys/arch/sparc64
parent755327f10676720e29b6c5b380070fbdca133628 (diff)
get rid of the assumption that the head of the alldevs list is the
"mainbus" device. this breaks when mpath is enabled because it attaches before mainbus and therefore takes the head position. have autoconf provide device_mainbus() which looks up mainbus_cd, and use that instead. discussed with deraadt who just wants mpath stuff to move forward despite there being many ways to shine this particular turd.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index be3d7ca1675..23ff1327fd9 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.149 2013/11/01 17:36:19 krw Exp $ */
+/* $OpenBSD: machdep.c,v 1.150 2014/03/13 03:52:56 dlg Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -610,6 +610,7 @@ boot(howto)
{
int i;
static char str[128];
+ struct device *mainbus;
/* If system is cold, just halt. */
if (cold) {
@@ -655,8 +656,9 @@ boot(howto)
haltsys:
doshutdownhooks();
- if (!TAILQ_EMPTY(&alldevs))
- config_suspend(TAILQ_FIRST(&alldevs), DVACT_POWERDOWN);
+ mainbus = device_mainbus();
+ if (mainbus != NULL)
+ config_suspend(mainbus, DVACT_POWERDOWN);
/* If powerdown was requested, do it. */
if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {