diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 17:55:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 17:55:48 -0500 |
commit | 221dee285ee38099b82437531bcae9fa9cb64cc4 (patch) | |
tree | 1f91186091f0256e04c210a8ac76023cdeebf202 | |
parent | 6f8c480f998a619082f18407f8d7f4c29e94dc6e (diff) |
Revert "[CPUFREQ] constify cpufreq_driver where possible."
This reverts commit aeeddc1435c37fa3fc844f31d39c185b08de4158, which was
half-baked and broken. It just resulted in compile errors, since
cpufreq_register_driver() still changes the 'driver_data' by setting
bits in the flags field. So claiming it is 'const' _really_ doesn't
work.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/e_powersaver.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/elanfreq.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/gx-suspmod.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/longhaul.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/longrun.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k6.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k7.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k8.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/sc520_freq.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-ich.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 4 | ||||
-rw-r--r-- | include/linux/cpufreq.h | 4 |
14 files changed, 17 insertions, 17 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c index 280b3177edbd..0d49d73d1b71 100644 --- a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c +++ b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c | |||
@@ -373,7 +373,7 @@ static int nforce2_cpu_exit(struct cpufreq_policy *policy) | |||
373 | return 0; | 373 | return 0; |
374 | } | 374 | } |
375 | 375 | ||
376 | static const struct cpufreq_driver nforce2_driver = { | 376 | static struct cpufreq_driver nforce2_driver = { |
377 | .name = "nforce2", | 377 | .name = "nforce2", |
378 | .verify = nforce2_verify, | 378 | .verify = nforce2_verify, |
379 | .target = nforce2_target, | 379 | .target = nforce2_target, |
diff --git a/arch/i386/kernel/cpu/cpufreq/e_powersaver.c b/arch/i386/kernel/cpu/cpufreq/e_powersaver.c index 8bedaad1193b..f43d98e11cc7 100644 --- a/arch/i386/kernel/cpu/cpufreq/e_powersaver.c +++ b/arch/i386/kernel/cpu/cpufreq/e_powersaver.c | |||
@@ -293,7 +293,7 @@ static struct freq_attr* eps_attr[] = { | |||
293 | NULL, | 293 | NULL, |
294 | }; | 294 | }; |
295 | 295 | ||
296 | static const struct cpufreq_driver eps_driver = { | 296 | static struct cpufreq_driver eps_driver = { |
297 | .verify = eps_verify, | 297 | .verify = eps_verify, |
298 | .target = eps_target, | 298 | .target = eps_target, |
299 | .init = eps_cpu_init, | 299 | .init = eps_cpu_init, |
diff --git a/arch/i386/kernel/cpu/cpufreq/elanfreq.c b/arch/i386/kernel/cpu/cpufreq/elanfreq.c index 6905de3a11e8..f317276afa7a 100644 --- a/arch/i386/kernel/cpu/cpufreq/elanfreq.c +++ b/arch/i386/kernel/cpu/cpufreq/elanfreq.c | |||
@@ -267,7 +267,7 @@ static struct freq_attr* elanfreq_attr[] = { | |||
267 | }; | 267 | }; |
268 | 268 | ||
269 | 269 | ||
270 | static const struct cpufreq_driver elanfreq_driver = { | 270 | static struct cpufreq_driver elanfreq_driver = { |
271 | .get = elanfreq_get_cpu_frequency, | 271 | .get = elanfreq_get_cpu_frequency, |
272 | .verify = elanfreq_verify, | 272 | .verify = elanfreq_verify, |
273 | .target = elanfreq_target, | 273 | .target = elanfreq_target, |
diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c index 9a66cab7fe14..6667e9cceb9f 100644 --- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c +++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c | |||
@@ -433,7 +433,7 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy) | |||
433 | * cpufreq_gx_init: | 433 | * cpufreq_gx_init: |
434 | * MediaGX/Geode GX initialize cpufreq driver | 434 | * MediaGX/Geode GX initialize cpufreq driver |
435 | */ | 435 | */ |
436 | static const struct cpufreq_driver gx_suspmod_driver = { | 436 | static struct cpufreq_driver gx_suspmod_driver = { |
437 | .get = gx_get_cpuspeed, | 437 | .get = gx_get_cpuspeed, |
438 | .verify = cpufreq_gx_verify, | 438 | .verify = cpufreq_gx_verify, |
439 | .target = cpufreq_gx_target, | 439 | .target = cpufreq_gx_target, |
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c index 8cc6952d7772..a1f1b715bcf8 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c | |||
@@ -821,7 +821,7 @@ static struct freq_attr* longhaul_attr[] = { | |||
821 | NULL, | 821 | NULL, |
822 | }; | 822 | }; |
823 | 823 | ||
824 | static const struct cpufreq_driver longhaul_driver = { | 824 | static struct cpufreq_driver longhaul_driver = { |
825 | .verify = longhaul_verify, | 825 | .verify = longhaul_verify, |
826 | .target = longhaul_target, | 826 | .target = longhaul_target, |
827 | .get = longhaul_get, | 827 | .get = longhaul_get, |
diff --git a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/i386/kernel/cpu/cpufreq/longrun.c index e11fd86ce8fb..b2689514295a 100644 --- a/arch/i386/kernel/cpu/cpufreq/longrun.c +++ b/arch/i386/kernel/cpu/cpufreq/longrun.c | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg) | 19 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg) |
20 | 20 | ||
21 | static const struct cpufreq_driver longrun_driver; | 21 | static struct cpufreq_driver longrun_driver; |
22 | 22 | ||
23 | /** | 23 | /** |
24 | * longrun_{low,high}_freq is needed for the conversion of cpufreq kHz | 24 | * longrun_{low,high}_freq is needed for the conversion of cpufreq kHz |
@@ -280,7 +280,7 @@ static int __init longrun_cpu_init(struct cpufreq_policy *policy) | |||
280 | } | 280 | } |
281 | 281 | ||
282 | 282 | ||
283 | static const struct cpufreq_driver longrun_driver = { | 283 | static struct cpufreq_driver longrun_driver = { |
284 | .flags = CPUFREQ_CONST_LOOPS, | 284 | .flags = CPUFREQ_CONST_LOOPS, |
285 | .verify = longrun_verify_policy, | 285 | .verify = longrun_verify_policy, |
286 | .setpolicy = longrun_set_policy, | 286 | .setpolicy = longrun_set_policy, |
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c index 2a0d89cb0b4b..f89524051e4a 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c | |||
@@ -195,7 +195,7 @@ static struct freq_attr* powernow_k6_attr[] = { | |||
195 | NULL, | 195 | NULL, |
196 | }; | 196 | }; |
197 | 197 | ||
198 | static const struct cpufreq_driver powernow_k6_driver = { | 198 | static struct cpufreq_driver powernow_k6_driver = { |
199 | .verify = powernow_k6_verify, | 199 | .verify = powernow_k6_verify, |
200 | .target = powernow_k6_target, | 200 | .target = powernow_k6_target, |
201 | .init = powernow_k6_cpu_init, | 201 | .init = powernow_k6_cpu_init, |
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c index d98529c93a1c..837b04166a47 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c | |||
@@ -647,7 +647,7 @@ static struct freq_attr* powernow_table_attr[] = { | |||
647 | NULL, | 647 | NULL, |
648 | }; | 648 | }; |
649 | 649 | ||
650 | static const struct cpufreq_driver powernow_driver = { | 650 | static struct cpufreq_driver powernow_driver = { |
651 | .verify = powernow_verify, | 651 | .verify = powernow_verify, |
652 | .target = powernow_target, | 652 | .target = powernow_target, |
653 | .get = powernow_get, | 653 | .get = powernow_get, |
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c index 8ed7b3af0553..fe3b67005ebb 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -1305,7 +1305,7 @@ static struct freq_attr* powernow_k8_attr[] = { | |||
1305 | NULL, | 1305 | NULL, |
1306 | }; | 1306 | }; |
1307 | 1307 | ||
1308 | static const struct cpufreq_driver cpufreq_amd64_driver = { | 1308 | static struct cpufreq_driver cpufreq_amd64_driver = { |
1309 | .verify = powernowk8_verify, | 1309 | .verify = powernowk8_verify, |
1310 | .target = powernowk8_target, | 1310 | .target = powernowk8_target, |
1311 | .init = powernowk8_cpu_init, | 1311 | .init = powernowk8_cpu_init, |
diff --git a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c b/arch/i386/kernel/cpu/cpufreq/sc520_freq.c index eddbe04a0841..b8fb4b521c62 100644 --- a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c +++ b/arch/i386/kernel/cpu/cpufreq/sc520_freq.c | |||
@@ -138,7 +138,7 @@ static struct freq_attr* sc520_freq_attr[] = { | |||
138 | }; | 138 | }; |
139 | 139 | ||
140 | 140 | ||
141 | static const struct cpufreq_driver sc520_freq_driver = { | 141 | static struct cpufreq_driver sc520_freq_driver = { |
142 | .get = sc520_freq_get_cpu_frequency, | 142 | .get = sc520_freq_get_cpu_frequency, |
143 | .verify = sc520_freq_verify, | 143 | .verify = sc520_freq_verify, |
144 | .target = sc520_freq_target, | 144 | .target = sc520_freq_target, |
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c index b94e347f08d3..b425cd3d1838 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c | |||
@@ -374,7 +374,7 @@ static struct freq_attr* speedstep_attr[] = { | |||
374 | }; | 374 | }; |
375 | 375 | ||
376 | 376 | ||
377 | static const struct cpufreq_driver speedstep_driver = { | 377 | static struct cpufreq_driver speedstep_driver = { |
378 | .name = "speedstep-ich", | 378 | .name = "speedstep-ich", |
379 | .verify = speedstep_verify, | 379 | .verify = speedstep_verify, |
380 | .target = speedstep_target, | 380 | .target = speedstep_target, |
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c index d4b7404bf315..ff0d89806114 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | |||
@@ -332,7 +332,7 @@ static struct freq_attr* speedstep_attr[] = { | |||
332 | NULL, | 332 | NULL, |
333 | }; | 333 | }; |
334 | 334 | ||
335 | static const struct cpufreq_driver speedstep_driver = { | 335 | static struct cpufreq_driver speedstep_driver = { |
336 | .name = "speedstep-smi", | 336 | .name = "speedstep-smi", |
337 | .verify = speedstep_verify, | 337 | .verify = speedstep_verify, |
338 | .target = speedstep_target, | 338 | .target = speedstep_target, |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index a12d6a236df1..f52facc570f5 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1752,7 +1752,7 @@ static struct notifier_block __cpuinitdata cpufreq_cpu_notifier = | |||
1752 | * (and isn't unregistered in the meantime). | 1752 | * (and isn't unregistered in the meantime). |
1753 | * | 1753 | * |
1754 | */ | 1754 | */ |
1755 | int cpufreq_register_driver(const struct cpufreq_driver *driver_data) | 1755 | int cpufreq_register_driver(struct cpufreq_driver *driver_data) |
1756 | { | 1756 | { |
1757 | unsigned long flags; | 1757 | unsigned long flags; |
1758 | int ret; | 1758 | int ret; |
@@ -1817,7 +1817,7 @@ EXPORT_SYMBOL_GPL(cpufreq_register_driver); | |||
1817 | * Returns zero if successful, and -EINVAL if the cpufreq_driver is | 1817 | * Returns zero if successful, and -EINVAL if the cpufreq_driver is |
1818 | * currently not initialised. | 1818 | * currently not initialised. |
1819 | */ | 1819 | */ |
1820 | int cpufreq_unregister_driver(const struct cpufreq_driver *driver) | 1820 | int cpufreq_unregister_driver(struct cpufreq_driver *driver) |
1821 | { | 1821 | { |
1822 | unsigned long flags; | 1822 | unsigned long flags; |
1823 | 1823 | ||
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 3a25235d79da..0899e2cdcdd1 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -225,8 +225,8 @@ struct cpufreq_driver { | |||
225 | #define CPUFREQ_PM_NO_WARN 0x04 /* don't warn on suspend/resume speed | 225 | #define CPUFREQ_PM_NO_WARN 0x04 /* don't warn on suspend/resume speed |
226 | * mismatches */ | 226 | * mismatches */ |
227 | 227 | ||
228 | int cpufreq_register_driver(const struct cpufreq_driver *driver_data); | 228 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); |
229 | int cpufreq_unregister_driver(const struct cpufreq_driver *driver_data); | 229 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); |
230 | 230 | ||
231 | 231 | ||
232 | void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state); | 232 | void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state); |