diff options
| -rw-r--r-- | drivers/sh/clk/core.c | 20 |
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, | |||
| 196 | struct cpufreq_frequency_table *freq_table, | 196 | struct cpufreq_frequency_table *freq_table, |
| 197 | unsigned long rate) | 197 | unsigned long rate) |
| 198 | { | 198 | { |
| 199 | int i; | 199 | struct cpufreq_frequency_table *pos; |
| 200 | |||
| 201 | for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) { | ||
| 202 | unsigned long freq = freq_table[i].frequency; | ||
| 203 | 200 | ||
| 204 | if (freq == CPUFREQ_ENTRY_INVALID) | 201 | cpufreq_for_each_valid_entry(pos, freq_table) |
| 205 | continue; | 202 | if (pos->frequency == rate) |
| 206 | 203 | return pos - freq_table; | |
| 207 | if (freq == rate) | ||
| 208 | return i; | ||
| 209 | } | ||
| 210 | 204 | ||
| 211 | return -ENOENT; | 205 | return -ENOENT; |
| 212 | } | 206 | } |
| @@ -575,11 +569,7 @@ long clk_round_parent(struct clk *clk, unsigned long target, | |||
| 575 | return abs(target - *best_freq); | 569 | return abs(target - *best_freq); |
| 576 | } | 570 | } |
| 577 | 571 | ||
| 578 | for (freq = parent->freq_table; freq->frequency != CPUFREQ_TABLE_END; | 572 | cpufreq_for_each_valid_entry(freq, parent->freq_table) { |
| 579 | freq++) { | ||
| 580 | if (freq->frequency == CPUFREQ_ENTRY_INVALID) | ||
| 581 | continue; | ||
| 582 | |||
| 583 | if (unlikely(freq->frequency / target <= div_min - 1)) { | 573 | if (unlikely(freq->frequency / target <= div_min - 1)) { |
| 584 | unsigned long freq_max; | 574 | unsigned long freq_max; |
| 585 | 575 | ||
