File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -527,7 +527,7 @@ static int ibmebus_bus_pm_resume_noirq(struct device *dev)
527527
528528#endif /* !CONFIG_SUSPEND */
529529
530- #ifdef CONFIG_HIBERNATION
530+ #ifdef CONFIG_HIBERNATE_CALLBACKS
531531
532532static int ibmebus_bus_pm_freeze (struct device * dev )
533533{
@@ -665,7 +665,7 @@ static int ibmebus_bus_pm_restore_noirq(struct device *dev)
665665 return ret ;
666666}
667667
668- #else /* !CONFIG_HIBERNATION */
668+ #else /* !CONFIG_HIBERNATE_CALLBACKS */
669669
670670#define ibmebus_bus_pm_freeze NULL
671671#define ibmebus_bus_pm_thaw NULL
@@ -676,7 +676,7 @@ static int ibmebus_bus_pm_restore_noirq(struct device *dev)
676676#define ibmebus_bus_pm_poweroff_noirq NULL
677677#define ibmebus_bus_pm_restore_noirq NULL
678678
679- #endif /* !CONFIG_HIBERNATION */
679+ #endif /* !CONFIG_HIBERNATE_CALLBACKS */
680680
681681static struct dev_pm_ops ibmebus_bus_dev_pm_ops = {
682682 .prepare = ibmebus_bus_pm_prepare ,
Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ static int amba_pm_resume_noirq(struct device *dev)
214214
215215#endif /* !CONFIG_SUSPEND */
216216
217- #ifdef CONFIG_HIBERNATION
217+ #ifdef CONFIG_HIBERNATE_CALLBACKS
218218
219219static int amba_pm_freeze (struct device * dev )
220220{
@@ -352,7 +352,7 @@ static int amba_pm_restore_noirq(struct device *dev)
352352 return ret ;
353353}
354354
355- #else /* !CONFIG_HIBERNATION */
355+ #else /* !CONFIG_HIBERNATE_CALLBACKS */
356356
357357#define amba_pm_freeze NULL
358358#define amba_pm_thaw NULL
@@ -363,7 +363,7 @@ static int amba_pm_restore_noirq(struct device *dev)
363363#define amba_pm_poweroff_noirq NULL
364364#define amba_pm_restore_noirq NULL
365365
366- #endif /* !CONFIG_HIBERNATION */
366+ #endif /* !CONFIG_HIBERNATE_CALLBACKS */
367367
368368#ifdef CONFIG_PM
369369
Original file line number Diff line number Diff line change @@ -771,7 +771,7 @@ int __weak platform_pm_resume_noirq(struct device *dev)
771771
772772#endif /* !CONFIG_SUSPEND */
773773
774- #ifdef CONFIG_HIBERNATION
774+ #ifdef CONFIG_HIBERNATE_CALLBACKS
775775
776776static int platform_pm_freeze (struct device * dev )
777777{
@@ -909,7 +909,7 @@ static int platform_pm_restore_noirq(struct device *dev)
909909 return ret ;
910910}
911911
912- #else /* !CONFIG_HIBERNATION */
912+ #else /* !CONFIG_HIBERNATE_CALLBACKS */
913913
914914#define platform_pm_freeze NULL
915915#define platform_pm_thaw NULL
@@ -920,7 +920,7 @@ static int platform_pm_restore_noirq(struct device *dev)
920920#define platform_pm_poweroff_noirq NULL
921921#define platform_pm_restore_noirq NULL
922922
923- #endif /* !CONFIG_HIBERNATION */
923+ #endif /* !CONFIG_HIBERNATE_CALLBACKS */
924924
925925#ifdef CONFIG_PM_RUNTIME
926926
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ static int pm_op(struct device *dev,
233233 }
234234 break ;
235235#endif /* CONFIG_SUSPEND */
236- #ifdef CONFIG_HIBERNATION
236+ #ifdef CONFIG_HIBERNATE_CALLBACKS
237237 case PM_EVENT_FREEZE :
238238 case PM_EVENT_QUIESCE :
239239 if (ops -> freeze ) {
@@ -260,7 +260,7 @@ static int pm_op(struct device *dev,
260260 suspend_report_result (ops -> restore , error );
261261 }
262262 break ;
263- #endif /* CONFIG_HIBERNATION */
263+ #endif /* CONFIG_HIBERNATE_CALLBACKS */
264264 default :
265265 error = - EINVAL ;
266266 }
@@ -308,7 +308,7 @@ static int pm_noirq_op(struct device *dev,
308308 }
309309 break ;
310310#endif /* CONFIG_SUSPEND */
311- #ifdef CONFIG_HIBERNATION
311+ #ifdef CONFIG_HIBERNATE_CALLBACKS
312312 case PM_EVENT_FREEZE :
313313 case PM_EVENT_QUIESCE :
314314 if (ops -> freeze_noirq ) {
@@ -335,7 +335,7 @@ static int pm_noirq_op(struct device *dev,
335335 suspend_report_result (ops -> restore_noirq , error );
336336 }
337337 break ;
338- #endif /* CONFIG_HIBERNATION */
338+ #endif /* CONFIG_HIBERNATE_CALLBACKS */
339339 default :
340340 error = - EINVAL ;
341341 }
Original file line number Diff line number Diff line change @@ -781,7 +781,7 @@ static int pci_pm_resume(struct device *dev)
781781
782782#endif /* !CONFIG_SUSPEND */
783783
784- #ifdef CONFIG_HIBERNATION
784+ #ifdef CONFIG_HIBERNATE_CALLBACKS
785785
786786static int pci_pm_freeze (struct device * dev )
787787{
@@ -970,7 +970,7 @@ static int pci_pm_restore(struct device *dev)
970970 return error ;
971971}
972972
973- #else /* !CONFIG_HIBERNATION */
973+ #else /* !CONFIG_HIBERNATE_CALLBACKS */
974974
975975#define pci_pm_freeze NULL
976976#define pci_pm_freeze_noirq NULL
@@ -981,7 +981,7 @@ static int pci_pm_restore(struct device *dev)
981981#define pci_pm_restore NULL
982982#define pci_pm_restore_noirq NULL
983983
984- #endif /* !CONFIG_HIBERNATION */
984+ #endif /* !CONFIG_HIBERNATE_CALLBACKS */
985985
986986#ifdef CONFIG_PM_RUNTIME
987987
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ static void xen_post_suspend(int cancelled)
6161 xen_mm_unpin_all ();
6262}
6363
64- #ifdef CONFIG_HIBERNATION
64+ #ifdef CONFIG_HIBERNATE_CALLBACKS
6565static int xen_suspend (void * data )
6666{
6767 struct suspend_info * si = data ;
@@ -173,7 +173,7 @@ static void do_suspend(void)
173173#endif
174174 shutting_down = SHUTDOWN_INVALID ;
175175}
176- #endif /* CONFIG_HIBERNATION */
176+ #endif /* CONFIG_HIBERNATE_CALLBACKS */
177177
178178struct shutdown_handler {
179179 const char * command ;
@@ -202,7 +202,7 @@ static void shutdown_handler(struct xenbus_watch *watch,
202202 { "poweroff" , do_poweroff },
203203 { "halt" , do_poweroff },
204204 { "reboot" , do_reboot },
205- #ifdef CONFIG_HIBERNATION
205+ #ifdef CONFIG_HIBERNATE_CALLBACKS
206206 { "suspend" , do_suspend },
207207#endif
208208 {NULL , NULL },
Original file line number Diff line number Diff line change @@ -249,6 +249,8 @@ extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
249249extern int hibernate (void );
250250extern bool system_entering_hibernation (void );
251251#else /* CONFIG_HIBERNATION */
252+ static inline void register_nosave_region (unsigned long b , unsigned long e ) {}
253+ static inline void register_nosave_region_late (unsigned long b , unsigned long e ) {}
252254static inline int swsusp_page_is_forbidden (struct page * p ) { return 0 ; }
253255static inline void swsusp_set_page_free (struct page * p ) {}
254256static inline void swsusp_unset_page_free (struct page * p ) {}
@@ -297,14 +299,7 @@ static inline bool pm_wakeup_pending(void) { return false; }
297299
298300extern struct mutex pm_mutex ;
299301
300- #ifndef CONFIG_HIBERNATION
301- static inline void register_nosave_region (unsigned long b , unsigned long e )
302- {
303- }
304- static inline void register_nosave_region_late (unsigned long b , unsigned long e )
305- {
306- }
307-
302+ #ifndef CONFIG_HIBERNATE_CALLBACKS
308303static inline void lock_system_sleep (void ) {}
309304static inline void unlock_system_sleep (void ) {}
310305
Original file line number Diff line number Diff line change @@ -18,9 +18,13 @@ config SUSPEND_FREEZER
1818
1919 Turning OFF this setting is NOT recommended! If in doubt, say Y.
2020
21+ config HIBERNATE_CALLBACKS
22+ bool
23+
2124config HIBERNATION
2225 bool "Hibernation (aka 'suspend to disk')"
2326 depends on SWAP && ARCH_HIBERNATION_POSSIBLE
27+ select HIBERNATE_CALLBACKS
2428 select LZO_COMPRESS
2529 select LZO_DECOMPRESS
2630 ---help---
@@ -85,7 +89,7 @@ config PM_STD_PARTITION
8589
8690config PM_SLEEP
8791 def_bool y
88- depends on SUSPEND || HIBERNATION || XEN_SAVE_RESTORE
92+ depends on SUSPEND || HIBERNATE_CALLBACKS || XEN_SAVE_RESTORE
8993
9094config PM_SLEEP_SMP
9195 def_bool y
You can’t perform that action at this time.
0 commit comments