Browse Source

[PATCH] Fix build failure in recent pm_prepare_* changes.

Fix compilation problem in PM headers.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Rafael J. Wysocki 19 years ago
parent
commit
46cd2f32ba
3 changed files with 12 additions and 18 deletions
  1. 9 1
      include/linux/suspend.h
  2. 3 1
      kernel/power/console.c
  3. 0 16
      kernel/power/power.h

+ 9 - 1
include/linux/suspend.h

@@ -42,13 +42,21 @@ extern void mark_free_pages(struct zone *zone);
 #ifdef CONFIG_PM
 #ifdef CONFIG_PM
 /* kernel/power/swsusp.c */
 /* kernel/power/swsusp.c */
 extern int software_suspend(void);
 extern int software_suspend(void);
+
+#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
+extern int pm_prepare_console(void);
+extern void pm_restore_console(void);
+#else
+static inline int pm_prepare_console(void) { return 0; }
+static inline void pm_restore_console(void) {}
+#endif /* defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) */
 #else
 #else
 static inline int software_suspend(void)
 static inline int software_suspend(void)
 {
 {
 	printk("Warning: fake suspend called\n");
 	printk("Warning: fake suspend called\n");
 	return -EPERM;
 	return -EPERM;
 }
 }
-#endif
+#endif /* CONFIG_PM */
 
 
 #ifdef CONFIG_SUSPEND_SMP
 #ifdef CONFIG_SUSPEND_SMP
 extern void disable_nonboot_cpus(void);
 extern void disable_nonboot_cpus(void);

+ 3 - 1
kernel/power/console.c

@@ -9,7 +9,9 @@
 #include <linux/console.h>
 #include <linux/console.h>
 #include "power.h"
 #include "power.h"
 
 
-#ifdef SUSPEND_CONSOLE
+#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
+#define SUSPEND_CONSOLE	(MAX_NR_CONSOLES-1)
+
 static int orig_fgconsole, orig_kmsg;
 static int orig_fgconsole, orig_kmsg;
 
 
 int pm_prepare_console(void)
 int pm_prepare_console(void)

+ 0 - 16
kernel/power/power.h

@@ -1,14 +1,6 @@
 #include <linux/suspend.h>
 #include <linux/suspend.h>
 #include <linux/utsname.h>
 #include <linux/utsname.h>
 
 
-/* With SUSPEND_CONSOLE defined suspend looks *really* cool, but
-   we probably do not take enough locks for switching consoles, etc,
-   so bad things might happen.
-*/
-#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
-#define SUSPEND_CONSOLE	(MAX_NR_CONSOLES-1)
-#endif
-
 struct swsusp_info {
 struct swsusp_info {
 	struct new_utsname	uts;
 	struct new_utsname	uts;
 	u32			version_code;
 	u32			version_code;
@@ -42,14 +34,6 @@ static struct subsys_attribute _name##_attr = {	\
 
 
 extern struct subsystem power_subsys;
 extern struct subsystem power_subsys;
 
 
-#ifdef SUSPEND_CONSOLE
-extern int pm_prepare_console(void);
-extern void pm_restore_console(void);
-#else
-static int pm_prepare_console(void) { return 0; }
-static void pm_restore_console(void) {}
-#endif
-
 /* References to section boundaries */
 /* References to section boundaries */
 extern const void __nosave_begin, __nosave_end;
 extern const void __nosave_begin, __nosave_end;