aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh/clk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sh/clk.c')
-rw-r--r--drivers/sh/clk.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/drivers/sh/clk.c b/drivers/sh/clk.c
index 936c93aaef11..cede14e34507 100644
--- a/drivers/sh/clk.c
+++ b/drivers/sh/clk.c
@@ -73,22 +73,14 @@ long clk_rate_table_round(struct clk *clk,
73{ 73{
74 unsigned long rate_error, rate_error_prev = ~0UL; 74 unsigned long rate_error, rate_error_prev = ~0UL;
75 unsigned long rate_best_fit = rate; 75 unsigned long rate_best_fit = rate;
76 unsigned long highest, lowest;
77 int i; 76 int i;
78 77
79 highest = lowest = 0;
80
81 for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) { 78 for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
82 unsigned long freq = freq_table[i].frequency; 79 unsigned long freq = freq_table[i].frequency;
83 80
84 if (freq == CPUFREQ_ENTRY_INVALID) 81 if (freq == CPUFREQ_ENTRY_INVALID)
85 continue; 82 continue;
86 83
87 if (freq > highest)
88 highest = freq;
89 if (freq < lowest)
90 lowest = freq;
91
92 rate_error = abs(freq - rate); 84 rate_error = abs(freq - rate);
93 if (rate_error < rate_error_prev) { 85 if (rate_error < rate_error_prev) {
94 rate_best_fit = freq; 86 rate_best_fit = freq;
@@ -99,11 +91,6 @@ long clk_rate_table_round(struct clk *clk,
99 break; 91 break;
100 } 92 }
101 93
102 if (rate >= highest)
103 rate_best_fit = highest;
104 if (rate <= lowest)
105 rate_best_fit = lowest;
106
107 return rate_best_fit; 94 return rate_best_fit;
108} 95}
109 96