diff mbox

[PM-WIP-OPP,1/1] OMAP3: PM: cpu-omap: Check governor limits before applying mpu frequency

Message ID 1269428551-779-1-git-send-email-eduardo.valentin@nokia.com (mailing list archive)
State Accepted
Delegated to: Kevin Hilman
Headers show

Commit Message

Eduardo Valentin March 24, 2010, 11:02 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
index a69b557..0674405 100644
--- a/arch/arm/plat-omap/cpu-omap.c
+++ b/arch/arm/plat-omap/cpu-omap.c
@@ -88,7 +88,7 @@  static int omap_target(struct cpufreq_policy *policy,
 	struct cpufreq_freqs freqs;
 #endif
 #if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
-	unsigned long freq = target_freq * 1000;
+	unsigned long freq;
 #endif
 	int ret = 0;
 
@@ -114,6 +114,7 @@  static int omap_target(struct cpufreq_policy *policy,
 	ret = clk_set_rate(mpu_clk, freqs.new * 1000);
 	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 #elif defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
+	freq = target_freq * 1000;
 	if (opp_find_freq_ceil(OPP_MPU, &freq))
 		omap_pm_cpu_set_freq(freq);
 #endif