diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-03-13 03:52:57 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-03-13 03:52:57 +0000 |
commit | ddb81f81c6b53bdfc4bba2ced060724d2beb0270 (patch) | |
tree | 84af82316dccb1276e4f2db46dffa3136279a846 /sys/arch/mvme68k | |
parent | 755327f10676720e29b6c5b380070fbdca133628 (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/mvme68k')
-rw-r--r-- | sys/arch/mvme68k/mvme68k/machdep.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c index 4fc09ca1823..e8ca9b58c1f 100644 --- a/sys/arch/mvme68k/mvme68k/machdep.c +++ b/sys/arch/mvme68k/mvme68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.131 2013/09/28 12:40:31 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.132 2014/03/13 03:52:55 dlg Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -451,6 +451,8 @@ __dead void boot(howto) int howto; { + struct device *mainbus; + /* If system is cold, just halt. */ if (cold) { /* (Unless the user explicitly asked for reboot.) */ @@ -493,8 +495,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 (howto & RB_HALT) { printf("System halted. Press any key to reboot...\n\n"); |