[RFC PATCH] ARM: smp_twd: Fix twd_get_clock() to get clock from dts or clock framework

dinguyen at altera.com dinguyen at altera.com
Fri Aug 9 18:35:19 EDT 2013


From: Dinh Nguyen <dinguyen at altera.com>

Some platforms have a clock for the smp_twd that goes through a fixed
divider. Registering this smp_twd clocks is done by calling
clk_register_fixed_factor().

Fix up twd_get_clock() so that it can get the clock from the device
tree node or clk_register_fixed_factor().

Signed-off-by: Dinh Nguyen <dinguyen at altera.com>
Cc: Viresh Kumar <viresh.linux at gmail.com>
Cc: Linus Walleij <linus.walleij at linaro.org>
Cc: Rob Herring <rob.herring at calxeda.com>
Cc: Arnd Bergmann <arnd at arndb.de>
CC: Russell King <linux at arm.linux.org.uk>
Cc: spear-devel at list.st.com
Cc: linux-arm-kernel at lists.infradead.org
---
 arch/arm/kernel/smp_twd.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 2595620..643b226 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -244,7 +244,10 @@ static void twd_get_clock(struct device_node *np)
 
 	if (np)
 		twd_clk = of_clk_get(np, 0);
-	else
+
+	/* Some platforms do not register the smp_twd clock in the device */
+	/* node of the twd timer. */
+	if (IS_ERR(twd_clk))	
 		twd_clk = clk_get_sys("smp_twd", NULL);
 
 	if (IS_ERR(twd_clk)) {
-- 
1.7.9.5





More information about the linux-arm-kernel mailing list