Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[sfrench/cifs-2.6.git] / drivers / base / power / suspend.c
index 50501764d0508a6493256380df820eb35b8c96e1..bdb60663f2eff5e9243921d8c0e144b8f1c7cd17 100644 (file)
@@ -8,11 +8,11 @@
  *
  */
 
+#include <linux/vt_kern.h>
 #include <linux/device.h>
+#include "../base.h"
 #include "power.h"
 
-extern int sysdev_suspend(pm_message_t state);
-
 /*
  * The entries in the dpm_active list are in a depth first order, simply
  * because children are guaranteed to be discovered after parents, and
@@ -63,7 +63,6 @@ int suspend_device(struct device * dev, pm_message_t state)
        return error;
 }
 
-
 /**
  *     device_suspend - Save state and stop all devices in system.
  *     @state:         Power state to put each device in.
@@ -83,6 +82,9 @@ int device_suspend(pm_message_t state)
 {
        int error = 0;
 
+       if (!is_console_suspend_safe())
+               return -EINVAL;
+
        down(&dpm_sem);
        down(&dpm_list_sem);
        while (!list_empty(&dpm_active) && error == 0) {