aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r--kernel/power/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 6096c71b182b..751157b7897e 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -25,7 +25,7 @@
25/*This is just an arbitrary number */ 25/*This is just an arbitrary number */
26#define FREE_PAGE_NUMBER (100) 26#define FREE_PAGE_NUMBER (100)
27 27
28DECLARE_MUTEX(pm_sem); 28DEFINE_MUTEX(pm_mutex);
29 29
30struct pm_ops *pm_ops; 30struct pm_ops *pm_ops;
31suspend_disk_method_t pm_disk_mode = PM_DISK_SHUTDOWN; 31suspend_disk_method_t pm_disk_mode = PM_DISK_SHUTDOWN;
@@ -37,9 +37,9 @@ suspend_disk_method_t pm_disk_mode = PM_DISK_SHUTDOWN;
37 37
38void pm_set_ops(struct pm_ops * ops) 38void pm_set_ops(struct pm_ops * ops)
39{ 39{
40 down(&pm_sem); 40 mutex_lock(&pm_mutex);
41 pm_ops = ops; 41 pm_ops = ops;
42 up(&pm_sem); 42 mutex_unlock(&pm_mutex);
43} 43}
44 44
45 45
@@ -183,7 +183,7 @@ static int enter_state(suspend_state_t state)
183 183
184 if (!valid_state(state)) 184 if (!valid_state(state))
185 return -ENODEV; 185 return -ENODEV;
186 if (down_trylock(&pm_sem)) 186 if (!mutex_trylock(&pm_mutex))
187 return -EBUSY; 187 return -EBUSY;
188 188
189 if (state == PM_SUSPEND_DISK) { 189 if (state == PM_SUSPEND_DISK) {
@@ -201,7 +201,7 @@ static int enter_state(suspend_state_t state)
201 pr_debug("PM: Finishing wakeup.\n"); 201 pr_debug("PM: Finishing wakeup.\n");
202 suspend_finish(state); 202 suspend_finish(state);
203 Unlock: 203 Unlock:
204 up(&pm_sem); 204 mutex_unlock(&pm_mutex);
205 return error; 205 return error;
206} 206}
207 207