diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2018-02-26 00:09:06 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-03-20 07:07:52 -0400 |
commit | ec8d2cc62ce5dd11000c3659ffd1d64e665372bb (patch) | |
tree | dc29f2c24bff63b0d7047e26e6f516be371087d2 | |
parent | 54a277ebf20d9bfae458c4a8af4308693d619830 (diff) |
cpufreq: sh: Don't validate the frequency table twice
The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.
Stop validating the frequency table from sh-cpufreq driver.
The driver though prints the min/max frequency values and the same is
done from the ->ready() callback now to keep the behavior unchanged.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/cpufreq/sh-cpufreq.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c index 28893d435cf5..5096c0ab781b 100644 --- a/drivers/cpufreq/sh-cpufreq.c +++ b/drivers/cpufreq/sh-cpufreq.c | |||
@@ -122,11 +122,7 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
122 | 122 | ||
123 | freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; | 123 | freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; |
124 | if (freq_table) { | 124 | if (freq_table) { |
125 | int result; | 125 | policy->freq_table = freq_table; |
126 | |||
127 | result = cpufreq_table_validate_and_show(policy, freq_table); | ||
128 | if (result) | ||
129 | return result; | ||
130 | } else { | 126 | } else { |
131 | dev_notice(dev, "no frequency table found, falling back " | 127 | dev_notice(dev, "no frequency table found, falling back " |
132 | "to rate rounding.\n"); | 128 | "to rate rounding.\n"); |
@@ -137,11 +133,6 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
137 | (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; | 133 | (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; |
138 | } | 134 | } |
139 | 135 | ||
140 | dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, " | ||
141 | "Maximum %u.%03u MHz.\n", | ||
142 | policy->min / 1000, policy->min % 1000, | ||
143 | policy->max / 1000, policy->max % 1000); | ||
144 | |||
145 | return 0; | 136 | return 0; |
146 | } | 137 | } |
147 | 138 | ||
@@ -155,6 +146,16 @@ static int sh_cpufreq_cpu_exit(struct cpufreq_policy *policy) | |||
155 | return 0; | 146 | return 0; |
156 | } | 147 | } |
157 | 148 | ||
149 | static void sh_cpufreq_cpu_ready(struct cpufreq_policy *policy) | ||
150 | { | ||
151 | struct device *dev = get_cpu_device(policy->cpu); | ||
152 | |||
153 | dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, " | ||
154 | "Maximum %u.%03u MHz.\n", | ||
155 | policy->min / 1000, policy->min % 1000, | ||
156 | policy->max / 1000, policy->max % 1000); | ||
157 | } | ||
158 | |||
158 | static struct cpufreq_driver sh_cpufreq_driver = { | 159 | static struct cpufreq_driver sh_cpufreq_driver = { |
159 | .name = "sh", | 160 | .name = "sh", |
160 | .flags = CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING, | 161 | .flags = CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING, |
@@ -163,6 +164,7 @@ static struct cpufreq_driver sh_cpufreq_driver = { | |||
163 | .verify = sh_cpufreq_verify, | 164 | .verify = sh_cpufreq_verify, |
164 | .init = sh_cpufreq_cpu_init, | 165 | .init = sh_cpufreq_cpu_init, |
165 | .exit = sh_cpufreq_cpu_exit, | 166 | .exit = sh_cpufreq_cpu_exit, |
167 | .ready = sh_cpufreq_cpu_ready, | ||
166 | .attr = cpufreq_generic_attr, | 168 | .attr = cpufreq_generic_attr, |
167 | }; | 169 | }; |
168 | 170 | ||