diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-26 13:40:53 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-26 13:40:53 +0200 |
commit | 43e8317b0bba1d6eb85f38a4a233d82d7c20d732 (patch) | |
tree | 9598176b6c0c0660df93541b1bd5f4ccc5ad450c /kernel/power/power.h | |
parent | 27ddcc6596e50cb8f03d2e83248897667811d8f6 (diff) |
PM / sleep: Use valid_state() for platform-dependent sleep states only
Use the observation that, for platform-dependent sleep states
(PM_SUSPEND_STANDBY, PM_SUSPEND_MEM), a given state is either
always supported or always unsupported and store that information
in pm_states[] instead of calling valid_state() every time we
need to check it.
Also do not use valid_state() for PM_SUSPEND_FREEZE, which is always
valid, and move the pm_test_level validity check for PM_SUSPEND_FREEZE
directly into enter_state().
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power/power.h')
-rw-r--r-- | kernel/power/power.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h index 99539c5da844..c60f13b5270a 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -186,14 +186,12 @@ struct pm_sleep_state { /* kernel/power/suspend.c */ extern struct pm_sleep_state pm_states[]; -extern bool valid_state(suspend_state_t state); extern int suspend_devices_and_enter(suspend_state_t state); #else /* !CONFIG_SUSPEND */ static inline int suspend_devices_and_enter(suspend_state_t state) { return -ENOSYS; } -static inline bool valid_state(suspend_state_t state) { return false; } #endif /* !CONFIG_SUSPEND */ #ifdef CONFIG_PM_TEST_SUSPEND |