summaryrefslogtreecommitdiff
path: root/drivers/sh
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-03 15:03:27 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-03 15:03:27 +0200
commit5ece2399181a5abaf42a4cb607463770686778e6 (patch)
tree5c789755fce670511f2ac1bc3eebf39e26ed1724 /drivers/sh
parentbf8102228a8bf053051f311e5486042fe0542894 (diff)
parent8d65775d17941d6d41f5913fc6a99a134c588e01 (diff)
downloadlwn-5ece2399181a5abaf42a4cb607463770686778e6.tar.gz
lwn-5ece2399181a5abaf42a4cb607463770686778e6.zip
Merge back earlier cpufreq material.
Conflicts: arch/mips/loongson/lemote-2f/clock.c drivers/cpufreq/intel_pstate.c
Diffstat (limited to 'drivers/sh')
-rw-r--r--drivers/sh/clk/core.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/sh/clk/core.c b/drivers/sh/clk/core.c
index 74727851820d..be56b22ca941 100644
--- a/drivers/sh/clk/core.c
+++ b/drivers/sh/clk/core.c
@@ -196,17 +196,11 @@ int clk_rate_table_find(struct clk *clk,
struct cpufreq_frequency_table *freq_table,
unsigned long rate)
{
- int i;
-
- for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
- unsigned long freq = freq_table[i].frequency;
+ struct cpufreq_frequency_table *pos;
- if (freq == CPUFREQ_ENTRY_INVALID)
- continue;
-
- if (freq == rate)
- return i;
- }
+ cpufreq_for_each_valid_entry(pos, freq_table)
+ if (pos->frequency == rate)
+ return pos - freq_table;
return -ENOENT;
}
@@ -575,11 +569,7 @@ long clk_round_parent(struct clk *clk, unsigned long target,
return abs(target - *best_freq);
}
- for (freq = parent->freq_table; freq->frequency != CPUFREQ_TABLE_END;
- freq++) {
- if (freq->frequency == CPUFREQ_ENTRY_INVALID)
- continue;
-
+ cpufreq_for_each_valid_entry(freq, parent->freq_table) {
if (unlikely(freq->frequency / target <= div_min - 1)) {
unsigned long freq_max;