*
*/
-#define DEBUG
-
#include <linux/suspend.h>
#include <linux/kobject.h>
#include <linux/string.h>
{
down(&pm_sem);
pm_ops = ops;
- if (ops->pm_disk_mode && ops->pm_disk_mode < PM_DISK_MAX)
- pm_disk_mode = ops->pm_disk_mode;
up(&pm_sem);
}
return error;
}
+/*
+ * This is main interface to the outside world. It needs to be
+ * called from process context.
+ */
+int software_suspend(void)
+{
+ return enter_state(PM_SUSPEND_DISK);
+}
+
/**
* pm_suspend - Externally visible function for suspending system.
p = memchr(buf, '\n', n);
len = p ? p - buf : n;
- for (s = &pm_states[state]; *s; s++, state++) {
- if (!strncmp(buf, *s, len))
+ for (s = &pm_states[state]; state < PM_SUSPEND_MAX; s++, state++) {
+ if (*s && !strncmp(buf, *s, len))
break;
}
if (*s)