[PATCH V5 39/63] SPEAr CPU freq: Adding support for CPU Freq framework

viresh kumar viresh.kumar at st.com
Thu Jan 20 22:40:26 EST 2011


On 01/20/2011 08:19 PM, Jamie Iles wrote:
>> > +	newfreq = clk_round_rate(cpu_clk, freqs.new * 1000);
>> > +	if (newfreq < 0) {
>> > +		pr_err("CPU Freq: clk_round_rate failed: %ld\n", newfreq);
>> > +		freqs.new = freqs.old;
> Nitpick, you don't need to assign freqs.new here as you return 
> immediately after.
> 
>> > +		return newfreq;
>> > +	}
>> > +
>> > +	freqs.new = newfreq / 1000;
>> > +
>> > +	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
>> > +
>> > +	/* Get current rate after clk_set_rate, for both success and failure */
>> > +	ret = clk_set_rate(cpu_clk, freqs.new * 1000);
>> > +	if (ret) {
>> > +		pr_err("CPU Freq: cpu clk_set_rate failed: %d\n", ret);
>> > +		freqs.new = clk_get_rate(cpu_clk) / 1000;
>> > +	}
>> > +
>> > +	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
>> > +	return 0;
> Shouldn't this return 'ret' here in case clk_set_rate() failed?

Will correct both of them.
I will resend this patch alone, instead of sending everything again.

-- 
viresh



More information about the linux-arm-kernel mailing list