diff options
author | Dave Jones <davej@redhat.com> | 2009-01-18 01:27:35 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2009-02-24 22:47:29 -0500 |
commit | 6072ace436800a011c3cb9a75ee49276bd90445a (patch) | |
tree | 395ea31a9233120e4f8e364fc7f090b394365711 | |
parent | 14a6650f13b958aabc30ddd575b0902384b22457 (diff) |
[CPUFREQ] checkpatch cleanups for sc520
Signed-off-by: Dave Jones <davej@redhat.com>
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/sc520_freq.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/sc520_freq.c b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c index 42da9bd677d6..435a996a613a 100644 --- a/arch/x86/kernel/cpu/cpufreq/sc520_freq.c +++ b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c | |||
@@ -19,17 +19,19 @@ | |||
19 | 19 | ||
20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
21 | #include <linux/cpufreq.h> | 21 | #include <linux/cpufreq.h> |
22 | #include <linux/timex.h> | ||
23 | #include <linux/io.h> | ||
22 | 24 | ||
23 | #include <asm/msr.h> | 25 | #include <asm/msr.h> |
24 | #include <asm/timex.h> | ||
25 | #include <asm/io.h> | ||
26 | 26 | ||
27 | #define MMCR_BASE 0xfffef000 /* The default base address */ | 27 | #define MMCR_BASE 0xfffef000 /* The default base address */ |
28 | #define OFFS_CPUCTL 0x2 /* CPU Control Register */ | 28 | #define OFFS_CPUCTL 0x2 /* CPU Control Register */ |
29 | 29 | ||
30 | static __u8 __iomem *cpuctl; | 30 | static __u8 __iomem *cpuctl; |
31 | 31 | ||
32 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "sc520_freq", msg) | 32 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \ |
33 | "sc520_freq", msg) | ||
34 | #define PFX "sc520_freq: " | ||
33 | 35 | ||
34 | static struct cpufreq_frequency_table sc520_freq_table[] = { | 36 | static struct cpufreq_frequency_table sc520_freq_table[] = { |
35 | {0x01, 100000}, | 37 | {0x01, 100000}, |
@@ -43,7 +45,8 @@ static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu) | |||
43 | 45 | ||
44 | switch (clockspeed_reg & 0x03) { | 46 | switch (clockspeed_reg & 0x03) { |
45 | default: | 47 | default: |
46 | printk(KERN_ERR "sc520_freq: error: cpuctl register has unexpected value %02x\n", clockspeed_reg); | 48 | printk(KERN_ERR PFX "error: cpuctl register has unexpected " |
49 | "value %02x\n", clockspeed_reg); | ||
47 | case 0x01: | 50 | case 0x01: |
48 | return 100000; | 51 | return 100000; |
49 | case 0x02: | 52 | case 0x02: |
@@ -51,7 +54,7 @@ static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu) | |||
51 | } | 54 | } |
52 | } | 55 | } |
53 | 56 | ||
54 | static void sc520_freq_set_cpu_state (unsigned int state) | 57 | static void sc520_freq_set_cpu_state(unsigned int state) |
55 | { | 58 | { |
56 | 59 | ||
57 | struct cpufreq_freqs freqs; | 60 | struct cpufreq_freqs freqs; |
@@ -76,18 +79,19 @@ static void sc520_freq_set_cpu_state (unsigned int state) | |||
76 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 79 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); |
77 | }; | 80 | }; |
78 | 81 | ||
79 | static int sc520_freq_verify (struct cpufreq_policy *policy) | 82 | static int sc520_freq_verify(struct cpufreq_policy *policy) |
80 | { | 83 | { |
81 | return cpufreq_frequency_table_verify(policy, &sc520_freq_table[0]); | 84 | return cpufreq_frequency_table_verify(policy, &sc520_freq_table[0]); |
82 | } | 85 | } |
83 | 86 | ||
84 | static int sc520_freq_target (struct cpufreq_policy *policy, | 87 | static int sc520_freq_target(struct cpufreq_policy *policy, |
85 | unsigned int target_freq, | 88 | unsigned int target_freq, |
86 | unsigned int relation) | 89 | unsigned int relation) |
87 | { | 90 | { |
88 | unsigned int newstate = 0; | 91 | unsigned int newstate = 0; |
89 | 92 | ||
90 | if (cpufreq_frequency_table_target(policy, sc520_freq_table, target_freq, relation, &newstate)) | 93 | if (cpufreq_frequency_table_target(policy, sc520_freq_table, |
94 | target_freq, relation, &newstate)) | ||
91 | return -EINVAL; | 95 | return -EINVAL; |
92 | 96 | ||
93 | sc520_freq_set_cpu_state(newstate); | 97 | sc520_freq_set_cpu_state(newstate); |
@@ -116,7 +120,7 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy) | |||
116 | 120 | ||
117 | result = cpufreq_frequency_table_cpuinfo(policy, sc520_freq_table); | 121 | result = cpufreq_frequency_table_cpuinfo(policy, sc520_freq_table); |
118 | if (result) | 122 | if (result) |
119 | return (result); | 123 | return result; |
120 | 124 | ||
121 | cpufreq_frequency_table_get_attr(sc520_freq_table, policy->cpu); | 125 | cpufreq_frequency_table_get_attr(sc520_freq_table, policy->cpu); |
122 | 126 | ||
@@ -131,7 +135,7 @@ static int sc520_freq_cpu_exit(struct cpufreq_policy *policy) | |||
131 | } | 135 | } |
132 | 136 | ||
133 | 137 | ||
134 | static struct freq_attr* sc520_freq_attr[] = { | 138 | static struct freq_attr *sc520_freq_attr[] = { |
135 | &cpufreq_freq_attr_scaling_available_freqs, | 139 | &cpufreq_freq_attr_scaling_available_freqs, |
136 | NULL, | 140 | NULL, |
137 | }; | 141 | }; |
@@ -155,13 +159,13 @@ static int __init sc520_freq_init(void) | |||
155 | int err; | 159 | int err; |
156 | 160 | ||
157 | /* Test if we have the right hardware */ | 161 | /* Test if we have the right hardware */ |
158 | if(c->x86_vendor != X86_VENDOR_AMD || | 162 | if (c->x86_vendor != X86_VENDOR_AMD || |
159 | c->x86 != 4 || c->x86_model != 9) { | 163 | c->x86 != 4 || c->x86_model != 9) { |
160 | dprintk("no Elan SC520 processor found!\n"); | 164 | dprintk("no Elan SC520 processor found!\n"); |
161 | return -ENODEV; | 165 | return -ENODEV; |
162 | } | 166 | } |
163 | cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1); | 167 | cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1); |
164 | if(!cpuctl) { | 168 | if (!cpuctl) { |
165 | printk(KERN_ERR "sc520_freq: error: failed to remap memory\n"); | 169 | printk(KERN_ERR "sc520_freq: error: failed to remap memory\n"); |
166 | return -ENOMEM; | 170 | return -ENOMEM; |
167 | } | 171 | } |