From: 黄涛 Date: Fri, 20 Apr 2012 04:15:10 +0000 (+0800) Subject: rk30: cpufreq: notify frequency change once X-Git-Tag: firefly_0821_release~9366 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0f37d777390d60ca6d0bf63d36d7f2cb7678e02a;p=firefly-linux-kernel-4.4.55.git rk30: cpufreq: notify frequency change once --- 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; }