Hibernation: Add PM_RESTORE_PREPARE and PM_POST_RESTORE notifiers (rev. 2)

Add PM_RESTORE_PREPARE and PM_POST_RESTORE notifiers to the PM core, to be used
in analogy with the existing PM_HIBERNATION_PREPARE and PM_POST_HIBERNATION
notifiers.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Alan Stern
2007-11-19 23:38:25 +01:00
committed by Len Brown
parent 2f8ed1c60b
commit c3e94d899c
4 changed files with 33 additions and 11 deletions

View File

@ -499,6 +499,10 @@ static int software_resume(void)
goto Unlock;
}
error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
if (error)
goto Finish;
error = create_basic_memory_bitmaps();
if (error)
goto Finish;
@ -522,6 +526,7 @@ static int software_resume(void)
Done:
free_basic_memory_bitmaps();
Finish:
pm_notifier_call_chain(PM_POST_RESTORE);
atomic_inc(&snapshot_device_available);
/* For success case, the suspend path will release the lock */
Unlock: