diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index 4a78a9596d6c..e6697162ed4a 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -263,8 +263,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) status = AcpiEnterSleepStateS4bios(); else status = AcpiEnterSleepState(state, acpi_sleep_flags); - - if (status != AE_OK) { + if (ACPI_FAILURE(status)) { device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n", AcpiFormatException(status)); diff --git a/sys/dev/acpica/Osd/OsdSynch.c b/sys/dev/acpica/Osd/OsdSynch.c index dedfa6e0a724..b70a12051ee7 100644 --- a/sys/dev/acpica/Osd/OsdSynch.c +++ b/sys/dev/acpica/Osd/OsdSynch.c @@ -208,7 +208,7 @@ AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handle, UINT32 Units, UINT16 Timeout) tmo -= slptick; } } - if (status == AE_OK) + if (ACPI_SUCCESS(status)) as->as_units -= Units; mtx_unlock(&as->as_lock); @@ -402,7 +402,7 @@ AcpiOsAcquireMutex(ACPI_MUTEX Handle, UINT16 Timeout) tmo -= slptick; } } - if (status == AE_OK) + if (ACPI_SUCCESS(status)) am->am_owner = curthread; mtx_unlock(&am->am_lock); diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c index 46e17d39d563..00a3073dae83 100644 --- a/sys/dev/acpica/acpi_ec.c +++ b/sys/dev/acpica/acpi_ec.c @@ -649,8 +649,8 @@ EcGpeQueryHandler(void *Context) Status = EcCommand(sc, EC_COMMAND_QUERY); if (ACPI_SUCCESS(Status)) break; - if (EcCheckStatus(sc, "retr_check", - EC_EVENT_INPUT_BUFFER_EMPTY) == AE_OK) + if (ACPI_SUCCESS(EcCheckStatus(sc, "retr_check", + EC_EVENT_INPUT_BUFFER_EMPTY))) continue; else break; @@ -845,7 +845,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event, u_int gen_count) DELAY(10); for (i = 0; i < count; i++) { Status = EcCheckStatus(sc, "poll", Event); - if (Status == AE_OK) + if (ACPI_SUCCESS(Status)) break; DELAY(EC_POLL_DELAY); } @@ -875,7 +875,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event, u_int gen_count) * event we are actually waiting for. */ Status = EcCheckStatus(sc, "sleep", Event); - if (Status == AE_OK) { + if (ACPI_SUCCESS(Status)) { if (gen_count == sc->ec_gencount) no_intr++; else @@ -890,7 +890,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event, u_int gen_count) * read the register once and trust whatever value we got. This is * the best we can do at this point. */ - if (Status != AE_OK) + if (ACPI_FAILURE(Status)) Status = EcCheckStatus(sc, "sleep_end", Event); } if (!need_poll && no_intr > 10) { @@ -898,7 +898,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event, u_int gen_count) "not getting interrupts, switched to polled mode\n"); ec_polled_mode = 1; } - if (Status != AE_OK) + if (ACPI_FAILURE(Status)) CTR0(KTR_ACPI, "error: ec wait timed out"); return (Status); } @@ -977,8 +977,8 @@ EcRead(struct acpi_ec_softc *sc, UINT8 Address, UINT8 *Data) EC_SET_DATA(sc, Address); status = EcWaitEvent(sc, EC_EVENT_OUTPUT_BUFFER_FULL, gen_count); if (ACPI_FAILURE(status)) { - if (EcCheckStatus(sc, "retr_check", - EC_EVENT_INPUT_BUFFER_EMPTY) == AE_OK) + if (ACPI_SUCCESS(EcCheckStatus(sc, "retr_check", + EC_EVENT_INPUT_BUFFER_EMPTY))) continue; else break; diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index a469588247de..dbdd2b745254 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -273,7 +273,7 @@ acpi_get_type(device_t dev) if ((h = acpi_get_handle(dev)) == NULL) return (ACPI_TYPE_NOT_FOUND); - if (AcpiGetType(h, &t) != AE_OK) + if (ACPI_FAILURE(AcpiGetType(h, &t))) return (ACPI_TYPE_NOT_FOUND); return (t); } diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c index 398ab4ca0c0b..fdd0732a5438 100644 --- a/sys/i386/acpica/acpi_wakeup.c +++ b/sys/i386/acpica/acpi_wakeup.c @@ -249,8 +249,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) status = AcpiEnterSleepStateS4bios(); else status = AcpiEnterSleepState(state, acpi_sleep_flags); - - if (status != AE_OK) { + if (ACPI_FAILURE(status)) { device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n", AcpiFormatException(status));