提交 499f8ad5 编写于 作者: S Stratos Karafotis 提交者: Rafael J. Wysocki

ARM: davinci: da850: Use cpufreq_for_each_entry macro for iteration

The cpufreq core now supports the cpufreq_for_each_entry macro helper
for iteration over the cpufreq_frequency_table, so use it.

It should have no functional changes.
Signed-off-by: NStratos Karafotis <stratosk@semaphore.gr>
Acked-and-tested-by: NLad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 041526f9
...@@ -1092,20 +1092,21 @@ int da850_register_cpufreq(char *async_clk) ...@@ -1092,20 +1092,21 @@ int da850_register_cpufreq(char *async_clk)
static int da850_round_armrate(struct clk *clk, unsigned long rate) static int da850_round_armrate(struct clk *clk, unsigned long rate)
{ {
int i, ret = 0, diff; int ret = 0, diff;
unsigned int best = (unsigned int) -1; unsigned int best = (unsigned int) -1;
struct cpufreq_frequency_table *table = cpufreq_info.freq_table; struct cpufreq_frequency_table *table = cpufreq_info.freq_table;
struct cpufreq_frequency_table *pos;
rate /= 1000; /* convert to kHz */ rate /= 1000; /* convert to kHz */
for (i = 0; table[i].frequency != CPUFREQ_TABLE_END; i++) { cpufreq_for_each_entry(pos, table) {
diff = table[i].frequency - rate; diff = pos->frequency - rate;
if (diff < 0) if (diff < 0)
diff = -diff; diff = -diff;
if (diff < best) { if (diff < best) {
best = diff; best = diff;
ret = table[i].frequency; ret = pos->frequency;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册