Thread (102 messages) 102 messages, 6 authors, 2011-03-01
STALE5690d

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

From: viresh kumar <hidden>
Date: 2011-01-21 03:40:26

On 01/20/2011 08:19 PM, Jamie Iles wrote:
quoted
quoted
+	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.
quoted
quoted
+		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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help