diff options
-rw-r--r-- | include/linux/suspend.h | 10 | ||||
-rw-r--r-- | kernel/power/console.c | 4 | ||||
-rw-r--r-- | kernel/power/power.h | 16 |
3 files changed, 12 insertions, 18 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 43bcd13eb1e..37c1c76fd54 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -42,13 +42,21 @@ extern void mark_free_pages(struct zone *zone); | |||
42 | #ifdef CONFIG_PM | 42 | #ifdef CONFIG_PM |
43 | /* kernel/power/swsusp.c */ | 43 | /* kernel/power/swsusp.c */ |
44 | extern int software_suspend(void); | 44 | extern int software_suspend(void); |
45 | |||
46 | #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) | ||
47 | extern int pm_prepare_console(void); | ||
48 | extern void pm_restore_console(void); | ||
49 | #else | ||
50 | static inline int pm_prepare_console(void) { return 0; } | ||
51 | static inline void pm_restore_console(void) {} | ||
52 | #endif /* defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) */ | ||
45 | #else | 53 | #else |
46 | static inline int software_suspend(void) | 54 | static inline int software_suspend(void) |
47 | { | 55 | { |
48 | printk("Warning: fake suspend called\n"); | 56 | printk("Warning: fake suspend called\n"); |
49 | return -EPERM; | 57 | return -EPERM; |
50 | } | 58 | } |
51 | #endif | 59 | #endif /* CONFIG_PM */ |
52 | 60 | ||
53 | #ifdef CONFIG_SUSPEND_SMP | 61 | #ifdef CONFIG_SUSPEND_SMP |
54 | extern void disable_nonboot_cpus(void); | 62 | extern void disable_nonboot_cpus(void); |
diff --git a/kernel/power/console.c b/kernel/power/console.c index 579d239d129..623786d4415 100644 --- a/kernel/power/console.c +++ b/kernel/power/console.c | |||
@@ -9,7 +9,9 @@ | |||
9 | #include <linux/console.h> | 9 | #include <linux/console.h> |
10 | #include "power.h" | 10 | #include "power.h" |
11 | 11 | ||
12 | #ifdef SUSPEND_CONSOLE | 12 | #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) |
13 | #define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1) | ||
14 | |||
13 | static int orig_fgconsole, orig_kmsg; | 15 | static int orig_fgconsole, orig_kmsg; |
14 | 16 | ||
15 | int pm_prepare_console(void) | 17 | int pm_prepare_console(void) |
diff --git a/kernel/power/power.h b/kernel/power/power.h index d8f0d1a76ba..388dba68084 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h | |||
@@ -1,14 +1,6 @@ | |||
1 | #include <linux/suspend.h> | 1 | #include <linux/suspend.h> |
2 | #include <linux/utsname.h> | 2 | #include <linux/utsname.h> |
3 | 3 | ||
4 | /* With SUSPEND_CONSOLE defined suspend looks *really* cool, but | ||
5 | we probably do not take enough locks for switching consoles, etc, | ||
6 | so bad things might happen. | ||
7 | */ | ||
8 | #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) | ||
9 | #define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1) | ||
10 | #endif | ||
11 | |||
12 | struct swsusp_info { | 4 | struct swsusp_info { |
13 | struct new_utsname uts; | 5 | struct new_utsname uts; |
14 | u32 version_code; | 6 | u32 version_code; |
@@ -42,14 +34,6 @@ static struct subsys_attribute _name##_attr = { \ | |||
42 | 34 | ||
43 | extern struct subsystem power_subsys; | 35 | extern struct subsystem power_subsys; |
44 | 36 | ||
45 | #ifdef SUSPEND_CONSOLE | ||
46 | extern int pm_prepare_console(void); | ||
47 | extern void pm_restore_console(void); | ||
48 | #else | ||
49 | static int pm_prepare_console(void) { return 0; } | ||
50 | static void pm_restore_console(void) {} | ||
51 | #endif | ||
52 | |||
53 | /* References to section boundaries */ | 37 | /* References to section boundaries */ |
54 | extern const void __nosave_begin, __nosave_end; | 38 | extern const void __nosave_begin, __nosave_end; |
55 | 39 | ||