Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162924686
D55225.id172216.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D55225.id172216.diff
View Options
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -2593,6 +2593,23 @@
{
}
+/*
+ * Simple wrapper around AcpiEnterSleepStatePrep() printing diagnostic on error.
+ */
+static ACPI_STATUS
+acpi_EnterSleepStatePrep(device_t acpi_dev, UINT8 SleepState)
+{
+ ACPI_STATUS status;
+
+ status = AcpiEnterSleepStatePrep(SleepState);
+ if (ACPI_FAILURE(status))
+ device_printf(acpi_dev,
+ "AcpiEnterSleepStatePrep(%u) failed - %s\n",
+ SleepState,
+ AcpiFormatException(status));
+ return (status);
+}
+
static void
acpi_shutdown_final(void *arg, int howto)
{
@@ -2606,9 +2623,9 @@
* an AP.
*/
if ((howto & RB_POWEROFF) != 0) {
- status = AcpiEnterSleepStatePrep(ACPI_STATE_S5);
+ status = acpi_EnterSleepStatePrep(sc->acpi_dev, ACPI_STATE_S5);
if (ACPI_FAILURE(status)) {
- device_printf(sc->acpi_dev, "AcpiEnterSleepStatePrep failed - %s\n",
+ device_printf(sc->acpi_dev, "Power-off preparation failed! - %s\n",
AcpiFormatException(status));
return;
}
@@ -3659,12 +3676,9 @@
slp_state |= ACPI_SS_DEV_SUSPEND;
if (stype != POWER_STYPE_SUSPEND_TO_IDLE) {
- status = AcpiEnterSleepStatePrep(acpi_sstate);
- if (ACPI_FAILURE(status)) {
- device_printf(sc->acpi_dev, "AcpiEnterSleepStatePrep failed - %s\n",
- AcpiFormatException(status));
+ status = acpi_EnterSleepStatePrep(sc->acpi_dev, acpi_sstate);
+ if (ACPI_FAILURE(status))
goto backout;
- }
slp_state |= ACPI_SS_SLP_PREP;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 19, 8:48 AM (17 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35217681
Default Alt Text
D55225.id172216.diff (1 KB)
Attached To
Mode
D55225: acpi: Factor out message printing on failure of AcpiEnterSleepStatePrep()
Attached
Detach File
Event Timeline
Log In to Comment