diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-03-26 20:32:51 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-03-26 20:32:51 +0000 |
commit | 953613c139e8651124de5ad59a781cc2bfdfd75f (patch) | |
tree | 54cb23f548f78ac74b09dae1a6ed0b71548a2c3e /sys | |
parent | b65bf2f27c1a3bf1115ca3a4ee1afd3438f1c314 (diff) |
simplify conditionals in acpi_sleep_state()
ok mlarkin
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/acpi/acpi.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 938e260fb26..f4f7424e525 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.229 2012/03/26 20:18:14 deraadt Exp $ */ +/* $OpenBSD: acpi.c,v 1.230 2012/03/26 20:32:50 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -1837,29 +1837,23 @@ acpi_sleep_state(struct acpi_softc *sc, int state) switch (state) { case ACPI_STATE_S0: - return (0); - case ACPI_STATE_S5: - break; case ACPI_STATE_S1: case ACPI_STATE_S2: - case ACPI_STATE_S3: - case ACPI_STATE_S4: - if (sc->sc_sleeptype[state].slp_typa == -1 || - sc->sc_sleeptype[state].slp_typb == -1) - return (EOPNOTSUPP); + case ACPI_STATE_S5: + return (0); } + if (sc->sc_sleeptype[state].slp_typa == -1 || + sc->sc_sleeptype[state].slp_typb == -1) + return (EOPNOTSUPP); + if ((ret = acpi_prepare_sleep_state(sc, state)) != 0) return (ret); - if (state != ACPI_STATE_S1) - ret = acpi_sleep_machdep(sc, state); - else - ret = acpi_enter_sleep_state(sc, state); + ret = acpi_sleep_machdep(sc, state); #ifndef SMALL_KERNEL - if (state == ACPI_STATE_S3 || state == ACPI_STATE_S4) - acpi_resume(sc, state); + acpi_resume(sc, state); #endif /* !SMALL_KERNEL */ return (ret); } |