diff options
-rw-r--r-- | sys/i386/bios/apm.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index f33bafd..1fe2e86 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -484,16 +484,16 @@ apm_do_suspend(void) apm_op_inprog = 0; sc->suspends = sc->suspend_countdown = 0; + EVENTHANDLER_INVOKE(power_suspend); + /* * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since * non-MPSAFE drivers need this. */ mtx_lock(&Giant); error = DEVICE_SUSPEND(root_bus); - if (error) { - mtx_unlock(&Giant); - return; - } + if (error) + goto backout; apm_execute_hook(hook[APM_HOOK_SUSPEND]); if (apm_suspend_system(PMST_SUSPEND) == 0) { @@ -504,8 +504,9 @@ apm_do_suspend(void) apm_execute_hook(hook[APM_HOOK_RESUME]); DEVICE_RESUME(root_bus); } +backout: mtx_unlock(&Giant); - return; + EVENTHANDLER_INVOKE(power_resume); } static void @@ -612,7 +613,7 @@ apm_resume(void) mtx_lock(&Giant); DEVICE_RESUME(root_bus); mtx_unlock(&Giant); - return; + EVENTHANDLER_INVOKE(power_resume); } |