aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-04-30 18:09:55 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-30 19:40:40 -0400
commit9684e51cd157607f0727c1550e7df6e31de40808 (patch)
treeeef6e19205a22817ee659cb2dc7b9ae39465c69d /kernel/power
parente8c9c502690efd24b7055bf608e7a3c34216848b (diff)
power management: force pm_ops.valid callback to be assigned
This patch changes the docs and behaviour from "all states valid" to "no states valid" if no .valid callback is assigned. Users of pm_ops that only need mem sleep can assign pm_valid_only_mem without any overhead, others will require more elaborate callbacks. Now that all users of pm_ops have a .valid callback this is a safe thing to do and prevents things from getting messy again as they were before. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Pavel Machek <pavel@ucw.cz> Looks-okay-to: Rafael J. Wysocki <rjw@sisk.pl> Cc: <linux-pm@lists.linux-foundation.org> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/main.c4
1 files changed, 2 insertions, 2 deletions
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}