@@ -647,7 +647,7 @@ static void power_down(void)
647647 */
648648int hibernate (void )
649649{
650- int error ;
650+ int error , nr_calls = 0 ;
651651
652652 if (!hibernation_available ()) {
653653 pr_debug ("PM: Hibernation not available.\n" );
@@ -662,9 +662,11 @@ int hibernate(void)
662662 }
663663
664664 pm_prepare_console ();
665- error = pm_notifier_call_chain (PM_HIBERNATION_PREPARE );
666- if (error )
665+ error = __pm_notifier_call_chain (PM_HIBERNATION_PREPARE , -1 , & nr_calls );
666+ if (error ) {
667+ nr_calls -- ;
667668 goto Exit ;
669+ }
668670
669671 printk (KERN_INFO "PM: Syncing filesystems ... " );
670672 sys_sync ();
@@ -714,7 +716,7 @@ int hibernate(void)
714716 /* Don't bother checking whether freezer_test_done is true */
715717 freezer_test_done = false;
716718 Exit :
717- pm_notifier_call_chain (PM_POST_HIBERNATION );
719+ __pm_notifier_call_chain (PM_POST_HIBERNATION , nr_calls , NULL );
718720 pm_restore_console ();
719721 atomic_inc (& snapshot_device_available );
720722 Unlock :
@@ -740,7 +742,7 @@ int hibernate(void)
740742 */
741743static int software_resume (void )
742744{
743- int error ;
745+ int error , nr_calls = 0 ;
744746 unsigned int flags ;
745747
746748 /*
@@ -827,9 +829,11 @@ static int software_resume(void)
827829 }
828830
829831 pm_prepare_console ();
830- error = pm_notifier_call_chain (PM_RESTORE_PREPARE );
831- if (error )
832+ error = __pm_notifier_call_chain (PM_RESTORE_PREPARE , -1 , & nr_calls );
833+ if (error ) {
834+ nr_calls -- ;
832835 goto Close_Finish ;
836+ }
833837
834838 pr_debug ("PM: Preparing processes for restore.\n" );
835839 error = freeze_processes ();
@@ -855,7 +859,7 @@ static int software_resume(void)
855859 unlock_device_hotplug ();
856860 thaw_processes ();
857861 Finish :
858- pm_notifier_call_chain (PM_POST_RESTORE );
862+ __pm_notifier_call_chain (PM_POST_RESTORE , nr_calls , NULL );
859863 pm_restore_console ();
860864 atomic_inc (& snapshot_device_available );
861865 /* For success case, the suspend path will release the lock */
0 commit comments