]> err.no Git - linux-2.6/commitdiff
[CPUFREQ] constify cpufreq_driver where possible.
authorDave Jones <davej@redhat.com>
Fri, 23 Feb 2007 00:08:27 +0000 (19:08 -0500)
committerDave Jones <davej@redhat.com>
Fri, 23 Feb 2007 00:08:27 +0000 (19:08 -0500)
Not all cases are possible due to ->flags being set at runtime
on some drivers.

Signed-off-by: Dave Jones <davej@redhat.com>
14 files changed:
arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c
arch/i386/kernel/cpu/cpufreq/e_powersaver.c
arch/i386/kernel/cpu/cpufreq/elanfreq.c
arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
arch/i386/kernel/cpu/cpufreq/longhaul.c
arch/i386/kernel/cpu/cpufreq/longrun.c
arch/i386/kernel/cpu/cpufreq/powernow-k6.c
arch/i386/kernel/cpu/cpufreq/powernow-k7.c
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
arch/i386/kernel/cpu/cpufreq/sc520_freq.c
arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h

index 0d49d73d1b711274387f6f23988415073774bc78..280b3177edbd0a1d28029f7a214b56f2efb3cb4b 100644 (file)
@@ -373,7 +373,7 @@ static int nforce2_cpu_exit(struct cpufreq_policy *policy)
        return 0;
 }
 
-static struct cpufreq_driver nforce2_driver = {
+static const struct cpufreq_driver nforce2_driver = {
        .name = "nforce2",
        .verify = nforce2_verify,
        .target = nforce2_target,
index f43d98e11cc72bbe72bc66a5b9cbcaac0704e2d7..8bedaad1193bdcb0a258f70cb9459a76c6a4a174 100644 (file)
@@ -293,7 +293,7 @@ static struct freq_attr* eps_attr[] = {
        NULL,
 };
 
-static struct cpufreq_driver eps_driver = {
+static const struct cpufreq_driver eps_driver = {
        .verify         = eps_verify,
        .target         = eps_target,
        .init           = eps_cpu_init,
index f317276afa7af179906f2035705bcf66a91d1824..6905de3a11e864e3b826a91856a9c7d73e75fb9c 100644 (file)
@@ -267,7 +267,7 @@ static struct freq_attr* elanfreq_attr[] = {
 };
 
 
-static struct cpufreq_driver elanfreq_driver = {
+static const struct cpufreq_driver elanfreq_driver = {
        .get            = elanfreq_get_cpu_frequency,
        .verify         = elanfreq_verify,
        .target         = elanfreq_target,
index 6667e9cceb9fd8c3dbfe5d75a93008b27111a997..9a66cab7fe14788bb15da723b8960effdff0e732 100644 (file)
@@ -433,7 +433,7 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
  * cpufreq_gx_init:
  *   MediaGX/Geode GX initialize cpufreq driver
  */
-static struct cpufreq_driver gx_suspmod_driver = {
+static const struct cpufreq_driver gx_suspmod_driver = {
        .get            = gx_get_cpuspeed,
        .verify         = cpufreq_gx_verify,
        .target         = cpufreq_gx_target,
index b59878a0d9b31a6f58b939f64bebadc656c55752..4459026cec07f68983b75cf28731b1b94699191b 100644 (file)
@@ -821,7 +821,7 @@ static struct freq_attr* longhaul_attr[] = {
        NULL,
 };
 
-static struct cpufreq_driver longhaul_driver = {
+static const struct cpufreq_driver longhaul_driver = {
        .verify = longhaul_verify,
        .target = longhaul_target,
        .get    = longhaul_get,
index b2689514295ab361057623dd7c2afb56d7deb81e..e11fd86ce8fb942a40fb48080efb4c472ad9aef3 100644 (file)
@@ -18,7 +18,7 @@
 
 #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg)
 
-static struct cpufreq_driver   longrun_driver;
+static const struct cpufreq_driver longrun_driver;
 
 /**
  * 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)
 }
 
 
-static struct cpufreq_driver longrun_driver = {
+static const struct cpufreq_driver longrun_driver = {
        .flags          = CPUFREQ_CONST_LOOPS,
        .verify         = longrun_verify_policy,
        .setpolicy      = longrun_set_policy,
index f89524051e4a3aa78012fd16a4179976764dc7ec..2a0d89cb0b4bd7f8e392eb85fe47302bf73b4c0a 100644 (file)
@@ -195,7 +195,7 @@ static struct freq_attr* powernow_k6_attr[] = {
        NULL,
 };
 
-static struct cpufreq_driver powernow_k6_driver = {
+static const struct cpufreq_driver powernow_k6_driver = {
        .verify         = powernow_k6_verify,
        .target         = powernow_k6_target,
        .init           = powernow_k6_cpu_init,
index 54382760983a11312c4eb8c9bc897636eb97631d..e8eb489501e0d5065be75ffce20214a1c7dc0f62 100644 (file)
@@ -647,7 +647,7 @@ static struct freq_attr* powernow_table_attr[] = {
        NULL,
 };
 
-static struct cpufreq_driver powernow_driver = {
+static const struct cpufreq_driver powernow_driver = {
        .verify = powernow_verify,
        .target = powernow_target,
        .get    = powernow_get,
index fe3b67005ebbb1d04ea17c20e804b47cf8cede7e..8ed7b3af0553bd8c121d2bb579a8501475466147 100644 (file)
@@ -1305,7 +1305,7 @@ static struct freq_attr* powernow_k8_attr[] = {
        NULL,
 };
 
-static struct cpufreq_driver cpufreq_amd64_driver = {
+static const struct cpufreq_driver cpufreq_amd64_driver = {
        .verify = powernowk8_verify,
        .target = powernowk8_target,
        .init = powernowk8_cpu_init,
index b8fb4b521c62806a2ec8e3134a281590e0dc8b7a..eddbe04a08416c1aed1d51f1310679c3ed4d90b1 100644 (file)
@@ -138,7 +138,7 @@ static struct freq_attr* sc520_freq_attr[] = {
 };
 
 
-static struct cpufreq_driver sc520_freq_driver = {
+static const struct cpufreq_driver sc520_freq_driver = {
        .get    = sc520_freq_get_cpu_frequency,
        .verify = sc520_freq_verify,
        .target = sc520_freq_target,
index b425cd3d1838377aee89ad50411b2f51b6d40306..b94e347f08d3959b53451f5a6dd14e98395fbf53 100644 (file)
@@ -374,7 +374,7 @@ static struct freq_attr* speedstep_attr[] = {
 };
 
 
-static struct cpufreq_driver speedstep_driver = {
+static const struct cpufreq_driver speedstep_driver = {
        .name   = "speedstep-ich",
        .verify = speedstep_verify,
        .target = speedstep_target,
index ff0d89806114b63b8db4010664cf410352c7ba80..d4b7404bf3159042b883052406ecaa0ce1bf3c01 100644 (file)
@@ -332,7 +332,7 @@ static struct freq_attr* speedstep_attr[] = {
        NULL,
 };
 
-static struct cpufreq_driver speedstep_driver = {
+static const struct cpufreq_driver speedstep_driver = {
        .name           = "speedstep-smi",
        .verify         = speedstep_verify,
        .target         = speedstep_target,
index f52facc570f57c97841b7a4bd809f6929bbe88a8..a12d6a236df1c53425df0068ff56f0cb3e9be72f 100644 (file)
@@ -1752,7 +1752,7 @@ static struct notifier_block __cpuinitdata cpufreq_cpu_notifier =
  * (and isn't unregistered in the meantime).
  *
  */
-int cpufreq_register_driver(struct cpufreq_driver *driver_data)
+int cpufreq_register_driver(const struct cpufreq_driver *driver_data)
 {
        unsigned long flags;
        int ret;
@@ -1817,7 +1817,7 @@ EXPORT_SYMBOL_GPL(cpufreq_register_driver);
  * Returns zero if successful, and -EINVAL if the cpufreq_driver is
  * currently not initialised.
  */
-int cpufreq_unregister_driver(struct cpufreq_driver *driver)
+int cpufreq_unregister_driver(const struct cpufreq_driver *driver)
 {
        unsigned long flags;
 
index 0899e2cdcdd15761c9e1eaccb926acde77294e1c..3a25235d79daa64145141789f2d1ee4236387010 100644 (file)
@@ -225,8 +225,8 @@ struct cpufreq_driver {
 #define CPUFREQ_PM_NO_WARN     0x04    /* don't warn on suspend/resume speed
                                         * mismatches */
 
-int cpufreq_register_driver(struct cpufreq_driver *driver_data);
-int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
+int cpufreq_register_driver(const struct cpufreq_driver *driver_data);
+int cpufreq_unregister_driver(const struct cpufreq_driver *driver_data);
 
 
 void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state);