aboutsummaryrefslogtreecommitdiff
path: root/drivers/base/power/resume.c
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>2007-05-23 14:19:41 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 16:09:01 -0700
commit11048dcf333c414f237bb713c422e68f67b115a3 (patch)
tree3a42905f9b946e5614568568c4ee1f8f54f54e86 /drivers/base/power/resume.c
parent9f3f776bd9e3d52f0204db1df0914b50d6a2372e (diff)
Power Management: use mutexes instead of semaphores
The Power Management code uses semaphores as mutexes. Use the mutex API instead of the (binary) semaphores. Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/power/resume.c')
-rw-r--r--drivers/base/power/resume.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/base/power/resume.c b/drivers/base/power/resume.c
index a2c64188d71..f6cfea496ea 100644
--- a/drivers/base/power/resume.c
+++ b/drivers/base/power/resume.c
@@ -80,7 +80,7 @@ static int resume_device_early(struct device * dev)
*/
void dpm_resume(void)
{
- down(&dpm_list_sem);
+ mutex_lock(&dpm_list_mtx);
while(!list_empty(&dpm_off)) {
struct list_head * entry = dpm_off.next;
struct device * dev = to_device(entry);
@@ -88,13 +88,13 @@ void dpm_resume(void)
get_device(dev);
list_move_tail(entry, &dpm_active);
- up(&dpm_list_sem);
+ mutex_unlock(&dpm_list_mtx);
if (!dev->power.prev_state.event)
resume_device(dev);
- down(&dpm_list_sem);
+ mutex_lock(&dpm_list_mtx);
put_device(dev);
}
- up(&dpm_list_sem);
+ mutex_unlock(&dpm_list_mtx);
}
@@ -108,9 +108,9 @@ void dpm_resume(void)
void device_resume(void)
{
might_sleep();
- down(&dpm_sem);
+ mutex_lock(&dpm_mtx);
dpm_resume();
- up(&dpm_sem);
+ mutex_unlock(&dpm_mtx);
}
EXPORT_SYMBOL_GPL(device_resume);