diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2012-05-22 05:18:30 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2012-05-22 05:18:30 +0000 |
commit | b4d1c5d0430699590ac00e065a440bb642bcd3fe (patch) | |
tree | cbfd6586bb44486342ce1b979019d7ce95b71d11 | |
parent | 73776eede3f92971a785b017473a36561910d0af (diff) | |
download | FreeBSD-src-b4d1c5d0430699590ac00e065a440bb642bcd3fe.zip FreeBSD-src-b4d1c5d0430699590ac00e065a440bb642bcd3fe.tar.gz |
Ignore the power button press event for resuming rather than starting
shutdown.
MFC after: 2 days
-rw-r--r-- | sys/dev/acpica/acpi.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index d96902b..ca9a4d6 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2515,6 +2515,11 @@ acpi_ReqSleepState(struct acpi_softc *sc, int state) if (!acpi_sleep_states[state]) return (EOPNOTSUPP); + /* If a suspend request is already in progress, just return. */ + if (sc->acpi_next_sstate != 0) { + return (0); + } + /* Wait until sleep is enabled. */ while (sc->acpi_sleep_disabled) { AcpiOsSleep(1000); @@ -2522,11 +2527,6 @@ acpi_ReqSleepState(struct acpi_softc *sc, int state) ACPI_LOCK(acpi); - /* If a suspend request is already in progress, just return. */ - if (sc->acpi_next_sstate != 0) { - ACPI_UNLOCK(acpi); - return (0); - } sc->acpi_next_sstate = state; /* S5 (soft-off) should be entered directly with no waiting. */ |