Do not invoke resume event handlers if suspend was successful.

Pointy hat to:	jkim
This commit is contained in:
Jung-uk Kim 2011-04-19 16:30:17 +00:00
parent 9c6d3b9f93
commit 51268821a9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=220844

View File

@ -499,11 +499,13 @@ apm_do_suspend(void)
if (apm_suspend_system(PMST_SUSPEND) == 0) {
sc->suspending = 1;
apm_processevent();
} else {
/* Failure, 'resume' the system again */
apm_execute_hook(hook[APM_HOOK_RESUME]);
DEVICE_RESUME(root_bus);
mtx_unlock(&Giant);
return;
}
/* Failure, 'resume' the system again */
apm_execute_hook(hook[APM_HOOK_RESUME]);
DEVICE_RESUME(root_bus);
backout:
mtx_unlock(&Giant);
EVENTHANDLER_INVOKE(power_resume);