diff options
author | akpm@osdl.org <akpm@osdl.org> | 2006-01-13 18:54:22 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-01-18 16:53:45 -0500 |
commit | 3fc54d37ab64733448faf0185e19a80f070eb9e3 (patch) | |
tree | 58f373f0e519007795fe58d8663b53bab4cb4feb /drivers/cpufreq/cpufreq.c | |
parent | 7eb9b2f56c9812d03ac63031869bcc42151067b1 (diff) |
[CPUFREQ] Convert drivers/cpufreq semaphores to mutexes.
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 277a843a87a6..eb2f19d00e93 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/cpu.h> | 27 | #include <linux/cpu.h> |
28 | #include <linux/completion.h> | 28 | #include <linux/completion.h> |
29 | #include <linux/mutex.h> | ||
29 | 30 | ||
30 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "cpufreq-core", msg) | 31 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "cpufreq-core", msg) |
31 | 32 | ||
@@ -55,7 +56,7 @@ static DECLARE_RWSEM (cpufreq_notifier_rwsem); | |||
55 | 56 | ||
56 | 57 | ||
57 | static LIST_HEAD(cpufreq_governor_list); | 58 | static LIST_HEAD(cpufreq_governor_list); |
58 | static DECLARE_MUTEX (cpufreq_governor_sem); | 59 | static DEFINE_MUTEX (cpufreq_governor_mutex); |
59 | 60 | ||
60 | struct cpufreq_policy * cpufreq_cpu_get(unsigned int cpu) | 61 | struct cpufreq_policy * cpufreq_cpu_get(unsigned int cpu) |
61 | { | 62 | { |
@@ -297,18 +298,18 @@ static int cpufreq_parse_governor (char *str_governor, unsigned int *policy, | |||
297 | return -EINVAL; | 298 | return -EINVAL; |
298 | } else { | 299 | } else { |
299 | struct cpufreq_governor *t; | 300 | struct cpufreq_governor *t; |
300 | down(&cpufreq_governor_sem); | 301 | mutex_lock(&cpufreq_governor_mutex); |
301 | if (!cpufreq_driver || !cpufreq_driver->target) | 302 | if (!cpufreq_driver || !cpufreq_driver->target) |
302 | goto out; | 303 | goto out; |
303 | list_for_each_entry(t, &cpufreq_governor_list, governor_list) { | 304 | list_for_each_entry(t, &cpufreq_governor_list, governor_list) { |
304 | if (!strnicmp(str_governor,t->name,CPUFREQ_NAME_LEN)) { | 305 | if (!strnicmp(str_governor,t->name,CPUFREQ_NAME_LEN)) { |
305 | *governor = t; | 306 | *governor = t; |
306 | up(&cpufreq_governor_sem); | 307 | mutex_unlock(&cpufreq_governor_mutex); |
307 | return 0; | 308 | return 0; |
308 | } | 309 | } |
309 | } | 310 | } |
310 | out: | 311 | out: |
311 | up(&cpufreq_governor_sem); | 312 | mutex_unlock(&cpufreq_governor_mutex); |
312 | } | 313 | } |
313 | return -EINVAL; | 314 | return -EINVAL; |
314 | } | 315 | } |
@@ -1217,17 +1218,17 @@ int cpufreq_register_governor(struct cpufreq_governor *governor) | |||
1217 | if (!governor) | 1218 | if (!governor) |
1218 | return -EINVAL; | 1219 | return -EINVAL; |
1219 | 1220 | ||
1220 | down(&cpufreq_governor_sem); | 1221 | mutex_lock(&cpufreq_governor_mutex); |
1221 | 1222 | ||
1222 | list_for_each_entry(t, &cpufreq_governor_list, governor_list) { | 1223 | list_for_each_entry(t, &cpufreq_governor_list, governor_list) { |
1223 | if (!strnicmp(governor->name,t->name,CPUFREQ_NAME_LEN)) { | 1224 | if (!strnicmp(governor->name,t->name,CPUFREQ_NAME_LEN)) { |
1224 | up(&cpufreq_governor_sem); | 1225 | mutex_unlock(&cpufreq_governor_mutex); |
1225 | return -EBUSY; | 1226 | return -EBUSY; |
1226 | } | 1227 | } |
1227 | } | 1228 | } |
1228 | list_add(&governor->governor_list, &cpufreq_governor_list); | 1229 | list_add(&governor->governor_list, &cpufreq_governor_list); |
1229 | 1230 | ||
1230 | up(&cpufreq_governor_sem); | 1231 | mutex_unlock(&cpufreq_governor_mutex); |
1231 | 1232 | ||
1232 | return 0; | 1233 | return 0; |
1233 | } | 1234 | } |
@@ -1239,9 +1240,9 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor) | |||
1239 | if (!governor) | 1240 | if (!governor) |
1240 | return; | 1241 | return; |
1241 | 1242 | ||
1242 | down(&cpufreq_governor_sem); | 1243 | mutex_lock(&cpufreq_governor_mutex); |
1243 | list_del(&governor->governor_list); | 1244 | list_del(&governor->governor_list); |
1244 | up(&cpufreq_governor_sem); | 1245 | mutex_unlock(&cpufreq_governor_mutex); |
1245 | return; | 1246 | return; |
1246 | } | 1247 | } |
1247 | EXPORT_SYMBOL_GPL(cpufreq_unregister_governor); | 1248 | EXPORT_SYMBOL_GPL(cpufreq_unregister_governor); |