diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2009-06-09 19:28:19 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2009-06-12 15:32:33 -0400 |
commit | fce2b111fae9151a53dabb36513b398d03337a19 (patch) | |
tree | 9349fce23fca0e2d90780e40aac2a6535f820c32 /include/linux/suspend.h | |
parent | 8b759b84c8b3c27ccc8dd787294636297b3ebb40 (diff) |
PM/Hibernate: Move NVS routines into a seperate file (v2).
The *_nvs_* routines in swsusp.c make use of the io*map()
functions, which are only provided for HAS_IOMEM, thus
breaking compilation if HAS_IOMEM is not set. Fix this
by moving the *_nvs_* routines into hibernate_nvs.c, which
is only compiled if HAS_IOMEM is set.
[rjw: Change the name of the new file to hibernate_nvs.c, add the
license line to the header comment.]
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r-- | include/linux/suspend.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 795032edfc46..cd15df6c63cd 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -245,11 +245,6 @@ extern unsigned long get_safe_page(gfp_t gfp_mask); | |||
245 | 245 | ||
246 | extern void hibernation_set_ops(struct platform_hibernation_ops *ops); | 246 | extern void hibernation_set_ops(struct platform_hibernation_ops *ops); |
247 | extern int hibernate(void); | 247 | extern int hibernate(void); |
248 | extern int hibernate_nvs_register(unsigned long start, unsigned long size); | ||
249 | extern int hibernate_nvs_alloc(void); | ||
250 | extern void hibernate_nvs_free(void); | ||
251 | extern void hibernate_nvs_save(void); | ||
252 | extern void hibernate_nvs_restore(void); | ||
253 | extern bool system_entering_hibernation(void); | 248 | extern bool system_entering_hibernation(void); |
254 | #else /* CONFIG_HIBERNATION */ | 249 | #else /* CONFIG_HIBERNATION */ |
255 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | 250 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } |
@@ -258,6 +253,16 @@ static inline void swsusp_unset_page_free(struct page *p) {} | |||
258 | 253 | ||
259 | static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {} | 254 | static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {} |
260 | static inline int hibernate(void) { return -ENOSYS; } | 255 | static inline int hibernate(void) { return -ENOSYS; } |
256 | static inline bool system_entering_hibernation(void) { return false; } | ||
257 | #endif /* CONFIG_HIBERNATION */ | ||
258 | |||
259 | #ifdef CONFIG_HIBERNATION_NVS | ||
260 | extern int hibernate_nvs_register(unsigned long start, unsigned long size); | ||
261 | extern int hibernate_nvs_alloc(void); | ||
262 | extern void hibernate_nvs_free(void); | ||
263 | extern void hibernate_nvs_save(void); | ||
264 | extern void hibernate_nvs_restore(void); | ||
265 | #else /* CONFIG_HIBERNATION_NVS */ | ||
261 | static inline int hibernate_nvs_register(unsigned long a, unsigned long b) | 266 | static inline int hibernate_nvs_register(unsigned long a, unsigned long b) |
262 | { | 267 | { |
263 | return 0; | 268 | return 0; |
@@ -266,8 +271,7 @@ static inline int hibernate_nvs_alloc(void) { return 0; } | |||
266 | static inline void hibernate_nvs_free(void) {} | 271 | static inline void hibernate_nvs_free(void) {} |
267 | static inline void hibernate_nvs_save(void) {} | 272 | static inline void hibernate_nvs_save(void) {} |
268 | static inline void hibernate_nvs_restore(void) {} | 273 | static inline void hibernate_nvs_restore(void) {} |
269 | static inline bool system_entering_hibernation(void) { return false; } | 274 | #endif /* CONFIG_HIBERNATION_NVS */ |
270 | #endif /* CONFIG_HIBERNATION */ | ||
271 | 275 | ||
272 | #ifdef CONFIG_PM_SLEEP | 276 | #ifdef CONFIG_PM_SLEEP |
273 | void save_processor_state(void); | 277 | void save_processor_state(void); |