diff options
Diffstat (limited to 'sys/dev/acpi/acpi.c')
-rw-r--r-- | sys/dev/acpi/acpi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 8c9f6064c7a..be06c51ea35 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.253 2014/02/21 23:48:38 deraadt Exp $ */ +/* $OpenBSD: acpi.c,v 1.254 2014/03/13 03:52:56 dlg Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -2098,6 +2098,7 @@ acpi_indicator(struct acpi_softc *sc, int led_state) int acpi_sleep_state(struct acpi_softc *sc, int state) { + struct device *mainbus = device_mainbus(); int error = ENXIO; int s; @@ -2127,7 +2128,7 @@ acpi_sleep_state(struct acpi_softc *sc, int state) #endif /* NWSDISPLAY > 0 */ bufq_quiesce(); - if (config_suspend(TAILQ_FIRST(&alldevs), DVACT_QUIESCE)) + if (config_suspend(mainbus, DVACT_QUIESCE)) goto fail_quiesce; #ifdef MULTIPROCESSOR @@ -2140,7 +2141,7 @@ acpi_sleep_state(struct acpi_softc *sc, int state) disable_intr(); /* PSL_I for resume; PIC/APIC broken until repair */ cold = 1; /* Force other code to delay() instead of tsleep() */ - if (config_suspend(TAILQ_FIRST(&alldevs), DVACT_SUSPEND) != 0) + if (config_suspend(mainbus, DVACT_SUSPEND) != 0) goto fail_suspend; acpi_sleep_clocks(sc, state); @@ -2172,7 +2173,7 @@ acpi_sleep_state(struct acpi_softc *sc, int state) acpi_resume_cpu(sc); fail_pts: - config_suspend(TAILQ_FIRST(&alldevs), DVACT_RESUME); + config_suspend(mainbus, DVACT_RESUME); fail_suspend: cold = 0; @@ -2192,7 +2193,7 @@ fail_suspend: fail_quiesce: bufq_restart(); - config_suspend(TAILQ_FIRST(&alldevs), DVACT_WAKEUP); + config_suspend(mainbus, DVACT_WAKEUP); #if NWSDISPLAY > 0 wsdisplay_resume(); |