diff options
Diffstat (limited to 'arch/arm/mach-davinci/da850.c')
-rw-r--r-- | arch/arm/mach-davinci/da850.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 85399c98f84a..45ce065e7170 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c | |||
@@ -1092,20 +1092,21 @@ int da850_register_cpufreq(char *async_clk) | |||
1092 | 1092 | ||
1093 | static int da850_round_armrate(struct clk *clk, unsigned long rate) | 1093 | static int da850_round_armrate(struct clk *clk, unsigned long rate) |
1094 | { | 1094 | { |
1095 | int i, ret = 0, diff; | 1095 | int ret = 0, diff; |
1096 | unsigned int best = (unsigned int) -1; | 1096 | unsigned int best = (unsigned int) -1; |
1097 | struct cpufreq_frequency_table *table = cpufreq_info.freq_table; | 1097 | struct cpufreq_frequency_table *table = cpufreq_info.freq_table; |
1098 | struct cpufreq_frequency_table *pos; | ||
1098 | 1099 | ||
1099 | rate /= 1000; /* convert to kHz */ | 1100 | rate /= 1000; /* convert to kHz */ |
1100 | 1101 | ||
1101 | for (i = 0; table[i].frequency != CPUFREQ_TABLE_END; i++) { | 1102 | cpufreq_for_each_entry(pos, table) { |
1102 | diff = table[i].frequency - rate; | 1103 | diff = pos->frequency - rate; |
1103 | if (diff < 0) | 1104 | if (diff < 0) |
1104 | diff = -diff; | 1105 | diff = -diff; |
1105 | 1106 | ||
1106 | if (diff < best) { | 1107 | if (diff < best) { |
1107 | best = diff; | 1108 | best = diff; |
1108 | ret = table[i].frequency; | 1109 | ret = pos->frequency; |
1109 | } | 1110 | } |
1110 | } | 1111 | } |
1111 | 1112 | ||