aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/resume.c
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>2007-05-23 17:19:41 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:09:01 -0400
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 a2c64188d713..f6cfea496ea0 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)
80 */ 80 */
81void dpm_resume(void) 81void dpm_resume(void)
82{ 82{
83 down(&dpm_list_sem); 83 mutex_lock(&dpm_list_mtx);
84 while(!list_empty(&dpm_off)) { 84 while(!list_empty(&dpm_off)) {
85 struct list_head * entry = dpm_off.next; 85 struct list_head * entry = dpm_off.next;
86 struct device * dev = to_device(entry); 86 struct device * dev = to_device(entry);
@@ -88,13 +88,13 @@ void dpm_resume(void)
88 get_device(dev); 88 get_device(dev);
89 list_move_tail(entry, &dpm_active); 89 list_move_tail(entry, &dpm_active);
90 90
91 up(&dpm_list_sem); 91 mutex_unlock(&dpm_list_mtx);
92 if (!dev->power.prev_state.event) 92 if (!dev->power.prev_state.event)
93 resume_device(dev); 93 resume_device(dev);
94 down(&dpm_list_sem); 94 mutex_lock(&dpm_list_mtx);
95 put_device(dev); 95 put_device(dev);
96 } 96 }
97 up(&dpm_list_sem); 97 mutex_unlock(&dpm_list_mtx);
98} 98}
99 99
100 100
@@ -108,9 +108,9 @@ void dpm_resume(void)
108void device_resume(void) 108void device_resume(void)
109{ 109{
110 might_sleep(); 110 might_sleep();
111 down(&dpm_sem); 111 mutex_lock(&dpm_mtx);
112 dpm_resume(); 112 dpm_resume();
113 up(&dpm_sem); 113 mutex_unlock(&dpm_mtx);
114} 114}
115 115
116EXPORT_SYMBOL_GPL(device_resume); 116EXPORT_SYMBOL_GPL(device_resume);