diff options
-rw-r--r-- | include/linux/pm.h | 12 | ||||
-rw-r--r-- | kernel/power/main.c | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index 6035209cf31e..7a516690dcb3 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -125,12 +125,12 @@ typedef int __bitwise suspend_disk_method_t; | |||
125 | * struct pm_ops - Callbacks for managing platform dependent suspend states. | 125 | * struct pm_ops - Callbacks for managing platform dependent suspend states. |
126 | * @valid: Callback to determine whether the given state can be entered. | 126 | * @valid: Callback to determine whether the given state can be entered. |
127 | * If %CONFIG_SOFTWARE_SUSPEND is set then %PM_SUSPEND_DISK is | 127 | * If %CONFIG_SOFTWARE_SUSPEND is set then %PM_SUSPEND_DISK is |
128 | * always valid and never passed to this call. | 128 | * always valid and never passed to this call. If not assigned, |
129 | * If not assigned, all suspend states are advertised as valid | 129 | * no suspend states are valid. |
130 | * in /sys/power/state (but can still be rejected by prepare or enter.) | 130 | * Valid states are advertised in /sys/power/state but can still |
131 | * Since new states can be added for other platforms, you should | 131 | * be rejected by prepare or enter if the conditions aren't right. |
132 | * assign this callback. There is a %pm_valid_only_mem function | 132 | * There is a %pm_valid_only_mem function available that can be assigned |
133 | * available if you only implemented mem sleep. | 133 | * to this if you only implement mem sleep. |
134 | * | 134 | * |
135 | * @prepare: Prepare the platform for the given suspend state. Can return a | 135 | * @prepare: Prepare the platform for the given suspend state. Can return a |
136 | * negative error code if necessary. | 136 | * negative error code if necessary. |
diff --git a/kernel/power/main.c b/kernel/power/main.c index f94f4e20115a..72419a3b1beb 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -198,8 +198,8 @@ static inline int valid_state(suspend_state_t state) | |||
198 | 198 | ||
199 | /* all other states need lowlevel support and need to be | 199 | /* all other states need lowlevel support and need to be |
200 | * valid to the lowlevel implementation, no valid callback | 200 | * valid to the lowlevel implementation, no valid callback |
201 | * implies that all are valid. */ | 201 | * implies that none are valid. */ |
202 | if (!pm_ops || (pm_ops->valid && !pm_ops->valid(state))) | 202 | if (!pm_ops || !pm_ops->valid || !pm_ops->valid(state)) |
203 | return 0; | 203 | return 0; |
204 | return 1; | 204 | return 1; |
205 | } | 205 | } |