The logic in omap-target can now be improved with the accessor
functions. Dont scan through the list manually, instead use
get_next_freq to do the scanning.

Cc: Benoit Cousson <b-cous...@ti.com>
Cc: Kevin Hilman <khil...@deeprootsystems.com>
Cc: Madhusudhan Chikkature Rajashekar <madhu...@ti.com>
Cc: Paul Walmsley <p...@pwsan.com>
Cc: Romit Dasgupta <ro...@ti.com>
Cc: Sanjeev Premi <pr...@ti.com>
Cc: Santosh Shilimkar <santosh.shilim...@ti.com>
Cc: Sergio Alberto Aguirre Rodriguez <saagui...@ti.com>
Cc: Thara Gopinath <th...@ti.com>
Cc: Vishwanath Sripathy <vishwanath...@ti.com>

Signed-off-by: Nishanth Menon <n...@ti.com>
---
 arch/arm/plat-omap/cpu-omap.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
index f9b480d..dac1eab 100644
--- a/arch/arm/plat-omap/cpu-omap.c
+++ b/arch/arm/plat-omap/cpu-omap.c
@@ -111,14 +111,10 @@ static int omap_target(struct cpufreq_policy *policy,
        cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 #elif defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
        if (mpu_opps) {
-               int ind;
-               for (ind = 1; ind <= MAX_VDD1_OPP; ind++) {
-                       if (mpu_opps[ind].rate/1000 >= target_freq) {
-                               omap_pm_cpu_set_freq
-                                       (mpu_opps[ind].rate);
-                               break;
-                       }
-               }
+               unsigned long freq = target_freq * 1000;
+               int res = get_next_freq(&freq, mpu_opps, true, true, false);
+               if (!res)
+                       omap_pm_cpu_set_freq(freq);
        }
 #endif
        return ret;
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to