diff options
author | Pavel Machek <pavel@ucw.cz> | 2004-10-28 23:20:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-28 23:20:47 -0700 |
commit | c1ec9cae63d7c8553172fddb199fbf61b7293c07 (patch) | |
tree | 9453d75d2490056aea239ba9ac4e6c3f5b1f43f6 /kernel | |
parent | 53b56386c1561f1aabb90ae3cfa279de1f08698f (diff) | |
download | history-c1ec9cae63d7c8553172fddb199fbf61b7293c07.tar.gz |
[PATCH] Add typechecking to suspend types and powerdown types
This adds typechecking to suspend types and powerdown types. This should
solve at least part of suspend type confusion. There should be no code
changes generated by this one.
Acked-by: Patrick Mochel <mochel@digitalimplant.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/disk.c | 5 | ||||
-rw-r--r-- | kernel/power/main.c | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 4462b7f1c6aad9..6089bbe5df42c3 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c @@ -16,10 +16,11 @@ #include <linux/device.h> #include <linux/delay.h> #include <linux/fs.h> +#include <linux/device.h> #include "power.h" -extern u32 pm_disk_mode; +extern suspend_disk_method_t pm_disk_mode; extern struct pm_ops * pm_ops; extern int swsusp_suspend(void); @@ -293,7 +294,7 @@ static ssize_t disk_store(struct subsystem * s, const char * buf, size_t n) int i; int len; char *p; - u32 mode = 0; + suspend_disk_method_t mode = 0; p = memchr(buf, '\n', n); len = p ? p - buf : n; diff --git a/kernel/power/main.c b/kernel/power/main.c index 2f08a432f0d51c..dc8a99225f0fcb 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -22,7 +22,7 @@ DECLARE_MUTEX(pm_sem); struct pm_ops * pm_ops = NULL; -u32 pm_disk_mode = PM_DISK_SHUTDOWN; +suspend_disk_method_t pm_disk_mode = PM_DISK_SHUTDOWN; /** * pm_set_ops - Set the global power method table. @@ -46,7 +46,7 @@ void pm_set_ops(struct pm_ops * ops) * the platform can enter the requested state. */ -static int suspend_prepare(u32 state) +static int suspend_prepare(suspend_state_t state) { int error = 0; @@ -102,7 +102,7 @@ static int suspend_enter(u32 state) * console that we've allocated. */ -static void suspend_finish(u32 state) +static void suspend_finish(suspend_state_t state) { device_resume(); if (pm_ops && pm_ops->finish) @@ -133,7 +133,7 @@ char * pm_states[] = { * we've woken up). */ -static int enter_state(u32 state) +static int enter_state(suspend_state_t state) { int error; @@ -183,7 +183,7 @@ int software_suspend(void) * structure, and enter (above). */ -int pm_suspend(u32 state) +int pm_suspend(suspend_state_t state) { if (state > PM_SUSPEND_ON && state < PM_SUSPEND_MAX) return enter_state(state); @@ -221,7 +221,7 @@ static ssize_t state_show(struct subsystem * subsys, char * buf) static ssize_t state_store(struct subsystem * subsys, const char * buf, size_t n) { - u32 state = PM_SUSPEND_STANDBY; + suspend_state_t state = PM_SUSPEND_STANDBY; char ** s; char *p; int error; |