mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
[PATCH] swsusp: switch pm_message_t to struct
This adds type-checking to pm_message_t, so that people can't confuse it with int or u32. It also allows us to fix "disk yoyo" during suspend (disk spinning down/up/down). [We've tried that before; since that cpufreq problems were fixed and I've tried make allyes config and fixed resulting damage.] Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Alexander Nyberg <alexn@telia.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
829ca9a30a
commit
ca078bae81
28 changed files with 108 additions and 101 deletions
|
@ -186,7 +186,9 @@ extern int pm_suspend(suspend_state_t state);
|
|||
|
||||
struct device;
|
||||
|
||||
typedef u32 __bitwise pm_message_t;
|
||||
typedef struct pm_message {
|
||||
int event;
|
||||
} pm_message_t;
|
||||
|
||||
/*
|
||||
* There are 4 important states driver can be in:
|
||||
|
@ -207,9 +209,13 @@ typedef u32 __bitwise pm_message_t;
|
|||
* or something similar soon.
|
||||
*/
|
||||
|
||||
#define PMSG_FREEZE ((__force pm_message_t) 3)
|
||||
#define PMSG_SUSPEND ((__force pm_message_t) 3)
|
||||
#define PMSG_ON ((__force pm_message_t) 0)
|
||||
#define PM_EVENT_ON 0
|
||||
#define PM_EVENT_FREEZE 1
|
||||
#define PM_EVENT_SUSPEND 2
|
||||
|
||||
#define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, })
|
||||
#define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, })
|
||||
#define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, })
|
||||
|
||||
struct dev_pm_info {
|
||||
pm_message_t power_state;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue