From 0f37d777390d60ca6d0bf63d36d7f2cb7678e02a Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Fri, 20 Apr 2012 12:15:10 +0800 Subject: [PATCH] rk30: cpufreq: notify frequency change once --- arch/arm/mach-rk30/cpufreq.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-rk30/cpufreq.c b/arch/arm/mach-rk30/cpufreq.c index 71d56ad83338..cad6459dd238 100755 --- a/arch/arm/mach-rk30/cpufreq.c +++ b/arch/arm/mach-rk30/cpufreq.c @@ -304,13 +304,13 @@ int cpufreq_scale_rate_for_dvfs(struct clk * clk,unsigned long rate,dvfs_set_rat unsigned int i; int ret=-EINVAL; struct cpufreq_freqs freqs; - - freqs.new=rate/1000; - freqs.old=rk30_getspeed(0); - - get_online_cpus(); - for_each_online_cpu(freqs.cpu) - cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); + + freqs.cpu = 0; + freqs.old = rk30_getspeed(0); + freqs.new = rate/1000; + + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); + FREQ_PRINTK_DBG("cpufreq_scale_rate_for_dvfs(%lu)\n",rate); ret = set_rate(clk,rate); @@ -325,12 +325,10 @@ int cpufreq_scale_rate_for_dvfs(struct clk * clk,unsigned long rate,dvfs_set_rat } #endif - freqs.old=freqs.new; - freqs.new=rk30_getspeed(0); - /* notifiers */ - for_each_online_cpu(freqs.cpu) - cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); - put_online_cpus(); + freqs.new = rk30_getspeed(0); + + cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); + return ret; } -- 2.34.1