aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/main.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-10-31 05:06:46 -0500
committerAnton Altaparmakov <aia21@cantab.net>2005-10-31 05:06:46 -0500
commit1f04c0a24b2f3cfe89c802a24396263623e3512d (patch)
treed7e2216b6e65b833c0c2b79b478d13ce17dbf296 /kernel/power/main.c
parent07b188ab773e183871e57b33ae37bf635c9f12ba (diff)
parente2f2e58e7968f8446b1078a20a18bf8ea12b4fbc (diff)
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r--kernel/power/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 22bdc93cc038..18d7d693fbba 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -167,6 +167,8 @@ static int enter_state(suspend_state_t state)
167{ 167{
168 int error; 168 int error;
169 169
170 if (pm_ops->valid && !pm_ops->valid(state))
171 return -ENODEV;
170 if (down_trylock(&pm_sem)) 172 if (down_trylock(&pm_sem))
171 return -EBUSY; 173 return -EBUSY;
172 174
@@ -236,7 +238,8 @@ static ssize_t state_show(struct subsystem * subsys, char * buf)
236 char * s = buf; 238 char * s = buf;
237 239
238 for (i = 0; i < PM_SUSPEND_MAX; i++) { 240 for (i = 0; i < PM_SUSPEND_MAX; i++) {
239 if (pm_states[i]) 241 if (pm_states[i] && pm_ops && (!pm_ops->valid
242 ||(pm_ops->valid && pm_ops->valid(i))))
240 s += sprintf(s,"%s ",pm_states[i]); 243 s += sprintf(s,"%s ",pm_states[i]);
241 } 244 }
242 s += sprintf(s,"\n"); 245 s += sprintf(s,"\n");