From 4db9e9bfd8b24b76fd8c30e12d0bc69afa75044a Mon Sep 17 00:00:00 2001 From: njl Date: Sat, 30 Jun 2007 17:27:31 +0000 Subject: [PATCH] My previous commit introduced a spurious warning for the case where a switch (i.e. lid) is set to have an action of NONE. This is not an invalid state, so silently return. This fixes the warning: "acpi: request to enter state S6 failed (err 22)" Approved by: re --- sys/dev/acpica/acpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index da91ce9d546f..06de4971c543 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2727,6 +2727,10 @@ acpi_system_eventhandler_sleep(void *arg, int state) ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, state); + /* Check if button action is disabled. */ + if (state == ACPI_S_STATES_MAX + 1) + return; + /* Request that the system prepare to enter the given suspend state. */ ret = acpi_ReqSleepState((struct acpi_softc *)arg, state); if (ret != 0)