@@ -19,10 +19,15 @@ config SUSPEND_FREEZER
Turning OFF this setting is NOT recommended! If in doubt, say Y.
config HIBERNATION
- bool "Hibernation (aka 'suspend to disk')"
- depends on SWAP && ARCH_HIBERNATION_POSSIBLE
+ def_bool n
+ depends on ARCH_HIBERNATION_POSSIBLE
select LZO_COMPRESS
select LZO_DECOMPRESS
+
+config HIBERNATION_INTERFACE
+ bool "Hibernation (aka 'suspend to disk')"
+ depends on SWAP
+ select HIBERNATION
---help---
Enable the suspend to disk (STD) functionality, which is usually
called "hibernation" in user interfaces. STD checkpoints the
@@ -592,6 +592,7 @@ static int prepare_processes(void)
* hibernate - The granpappy of the built-in hibernation management
*/
+#ifdef CONFIG_HIBERNATION_INTERFACE
int hibernate(void)
{
int error;
@@ -667,6 +668,8 @@ int hibernate(void)
return error;
}
+#else /* !CONFIG_HIBERNATION_INTERFACE */
+int hibernate(void) { return -ENOSYS; }
/**
* software_resume - Resume from a saved image.
@@ -1029,3 +1032,4 @@ __setup("noresume", noresume_setup);
__setup("resume_offset=", resume_offset_setup);
__setup("resume=", resume_setup);
__setup("hibernate=", hibernate_setup);
+#endif /* !CONFIG_HIBERNATION_INTERFACE */
@@ -156,7 +156,7 @@ static ssize_t state_show(struct kobject *kobj, struct kobj_attribute *attr,
s += sprintf(s,"%s ", pm_states[i]);
}
#endif
-#ifdef CONFIG_HIBERNATION
+#ifdef CONFIG_HIBERNATION_INTERFACE
s += sprintf(s, "%s\n", "disk");
#else
if (s != buf)
@@ -458,6 +458,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
return error;
}
+#ifdef CONFIG_HIBERNATION_INTERFACE
static const struct file_operations snapshot_fops = {
.open = snapshot_open,
.release = snapshot_release,
@@ -479,3 +480,4 @@ static int __init snapshot_device_init(void)
};
device_initcall(snapshot_device_init);
+#endif /* CONFIG_HIBERNATION_INTERFACE */