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/arm/xscale/pxa2x0_apm.c | |
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/arm/xscale/pxa2x0_apm.c')
-rw-r--r-- | sys/arch/arm/xscale/pxa2x0_apm.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_apm.c b/sys/arch/arm/xscale/pxa2x0_apm.c index 8f55ff95b54..7d4a97388a3 100644 --- a/sys/arch/arm/xscale/pxa2x0_apm.c +++ b/sys/arch/arm/xscale/pxa2x0_apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_apm.c,v 1.41 2013/12/06 21:03:05 deraadt Exp $ */ +/* $OpenBSD: pxa2x0_apm.c,v 1.42 2014/03/13 03:52:55 dlg Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -306,6 +306,7 @@ apm_power_info(struct pxa2x0_apm_softc *sc, void apm_suspend(struct pxa2x0_apm_softc *sc) { + struct device *mainbus = device_mainbus(); int s; #if NWSDISPLAY > 0 @@ -320,14 +321,14 @@ apm_suspend(struct pxa2x0_apm_softc *sc) sc->sc_suspend(sc); s = splhigh(); - config_suspend(TAILQ_FIRST(&alldevs), DVACT_SUSPEND); + config_suspend(mainbus, DVACT_SUSPEND); /* XXX * Flag to disk drivers that they should "power down" the disk * when we get to DVACT_POWERDOWN. */ boothowto |= RB_POWERDOWN; - config_suspend(TAILQ_FIRST(&alldevs), DVACT_POWERDOWN); + config_suspend(mainbus, DVACT_POWERDOWN); boothowto &= ~RB_POWERDOWN; splx(s); @@ -338,10 +339,11 @@ apm_suspend(struct pxa2x0_apm_softc *sc) void apm_resume(struct pxa2x0_apm_softc *sc) { + struct device *mainbus = device_mainbus(); int s; s = splhigh(); - config_suspend(TAILQ_FIRST(&alldevs), DVACT_RESUME); + config_suspend(mainbus, DVACT_RESUME); splx(s); inittodr(0); @@ -355,7 +357,7 @@ apm_resume(struct pxa2x0_apm_softc *sc) bufq_restart(); - config_suspend(TAILQ_FIRST(&alldevs), DVACT_WAKEUP); + config_suspend(mainbus, DVACT_WAKEUP); #if NWSDISPLAY > 0 wsdisplay_resume(); |