diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-04-01 08:57:48 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-02 09:26:32 -0400 |
commit | eb2f50ff93f08c8001d0d7e1148948ba80989aaf (patch) | |
tree | 8e598c3c7e47ce6c79e98a9d2eb91e7e555ee61f /arch | |
parent | 8a00627a187dca212c43a511852f06dd2c94b9aa (diff) |
cpufreq: drivers: Remove unnecessary assignments of policy-> members
Some assignments of policy-> min/max/cur/cpuinfo.min_freq/cpuinfo.max_freq
aren't required as part of it is done by cpufreq driver or cpufreq core.
Remove them.
At some places we merge multiple lines together too.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-davinci/cpufreq.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-imx/cpufreq.c | 3 | ||||
-rw-r--r-- | arch/sh/kernel/cpufreq.c | 9 |
3 files changed, 11 insertions, 22 deletions
diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c index 8fb0c2ac227e..7c2e943c5500 100644 --- a/arch/arm/mach-davinci/cpufreq.c +++ b/arch/arm/mach-davinci/cpufreq.c | |||
@@ -137,21 +137,16 @@ static int davinci_cpu_init(struct cpufreq_policy *policy) | |||
137 | return result; | 137 | return result; |
138 | } | 138 | } |
139 | 139 | ||
140 | policy->cur = policy->min = policy->max = davinci_getspeed(0); | 140 | policy->cur = davinci_getspeed(0); |
141 | 141 | ||
142 | if (freq_table) { | 142 | result = cpufreq_frequency_table_cpuinfo(policy, freq_table); |
143 | result = cpufreq_frequency_table_cpuinfo(policy, freq_table); | 143 | if (result) { |
144 | if (!result) | 144 | pr_err("%s: cpufreq_frequency_table_cpuinfo() failed", |
145 | cpufreq_frequency_table_get_attr(freq_table, | 145 | __func__); |
146 | policy->cpu); | 146 | return result; |
147 | } else { | ||
148 | policy->cpuinfo.min_freq = policy->min; | ||
149 | policy->cpuinfo.max_freq = policy->max; | ||
150 | } | 147 | } |
151 | 148 | ||
152 | policy->min = policy->cpuinfo.min_freq; | 149 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); |
153 | policy->max = policy->cpuinfo.max_freq; | ||
154 | policy->cur = davinci_getspeed(0); | ||
155 | 150 | ||
156 | /* | 151 | /* |
157 | * Time measurement across the target() function yields ~1500-1800us | 152 | * Time measurement across the target() function yields ~1500-1800us |
diff --git a/arch/arm/mach-imx/cpufreq.c b/arch/arm/mach-imx/cpufreq.c index cfce5e3f67f5..387dc4cceca2 100644 --- a/arch/arm/mach-imx/cpufreq.c +++ b/arch/arm/mach-imx/cpufreq.c | |||
@@ -144,14 +144,11 @@ static int mxc_cpufreq_init(struct cpufreq_policy *policy) | |||
144 | imx_freq_table[i].frequency = CPUFREQ_TABLE_END; | 144 | imx_freq_table[i].frequency = CPUFREQ_TABLE_END; |
145 | 145 | ||
146 | policy->cur = clk_get_rate(cpu_clk) / 1000; | 146 | policy->cur = clk_get_rate(cpu_clk) / 1000; |
147 | policy->min = policy->cpuinfo.min_freq = cpu_freq_khz_min; | ||
148 | policy->max = policy->cpuinfo.max_freq = cpu_freq_khz_max; | ||
149 | 147 | ||
150 | /* Manual states, that PLL stabilizes in two CLK32 periods */ | 148 | /* Manual states, that PLL stabilizes in two CLK32 periods */ |
151 | policy->cpuinfo.transition_latency = 2 * NANOSECOND / CLK32_FREQ; | 149 | policy->cpuinfo.transition_latency = 2 * NANOSECOND / CLK32_FREQ; |
152 | 150 | ||
153 | ret = cpufreq_frequency_table_cpuinfo(policy, imx_freq_table); | 151 | ret = cpufreq_frequency_table_cpuinfo(policy, imx_freq_table); |
154 | |||
155 | if (ret < 0) { | 152 | if (ret < 0) { |
156 | printk(KERN_ERR "%s: failed to register i.MXC CPUfreq with error code %d\n", | 153 | printk(KERN_ERR "%s: failed to register i.MXC CPUfreq with error code %d\n", |
157 | __func__, ret); | 154 | __func__, ret); |
diff --git a/arch/sh/kernel/cpufreq.c b/arch/sh/kernel/cpufreq.c index 0fdf64b759c8..88c8feedf785 100644 --- a/arch/sh/kernel/cpufreq.c +++ b/arch/sh/kernel/cpufreq.c | |||
@@ -116,7 +116,7 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
116 | return PTR_ERR(cpuclk); | 116 | return PTR_ERR(cpuclk); |
117 | } | 117 | } |
118 | 118 | ||
119 | policy->cur = policy->min = policy->max = sh_cpufreq_get(cpu); | 119 | policy->cur = sh_cpufreq_get(cpu); |
120 | 120 | ||
121 | freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; | 121 | freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; |
122 | if (freq_table) { | 122 | if (freq_table) { |
@@ -129,15 +129,12 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
129 | dev_notice(dev, "no frequency table found, falling back " | 129 | dev_notice(dev, "no frequency table found, falling back " |
130 | "to rate rounding.\n"); | 130 | "to rate rounding.\n"); |
131 | 131 | ||
132 | policy->cpuinfo.min_freq = | 132 | policy->min = policy->cpuinfo.min_freq = |
133 | (clk_round_rate(cpuclk, 1) + 500) / 1000; | 133 | (clk_round_rate(cpuclk, 1) + 500) / 1000; |
134 | policy->cpuinfo.max_freq = | 134 | policy->max = policy->cpuinfo.max_freq = |
135 | (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; | 135 | (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; |
136 | } | 136 | } |
137 | 137 | ||
138 | policy->min = policy->cpuinfo.min_freq; | ||
139 | policy->max = policy->cpuinfo.max_freq; | ||
140 | |||
141 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; | 138 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; |
142 | 139 | ||
143 | dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, " | 140 | dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, " |