[PATCH] swsusp: add check for suspension of X-controlled devices
[pandora-kernel.git] / drivers / char / vt.c
index 0900d1d..86b31b8 100644 (file)
@@ -3234,6 +3234,14 @@ void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org)
        }
 }
 
+int is_console_suspend_safe(void)
+{
+       /* It is unsafe to suspend devices while X has control of the
+        * hardware. Make sure we are running on a kernel-controlled console.
+        */
+       return vc_cons[fg_console].d->vc_mode == KD_TEXT;
+}
+
 /*
  *     Visible symbols for modules
  */