[PATCH 5/5] [RFC] ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding

Geert Uytterhoeven geert+renesas at glider.be
Fri May 29 02:25:49 PDT 2015


Signed-off-by: Geert Uytterhoeven <geert+renesas at glider.be>
---
This is an RFC, as it depends on "[RFC] clk: Provide dummy
of_clk_get_parent_count() for !OF/!CCF".
---
 arch/arm/common/timer-sp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
index 19211324772f387c..be87a5d480ffb655 100644
--- a/arch/arm/common/timer-sp.c
+++ b/arch/arm/common/timer-sp.c
@@ -21,6 +21,7 @@
 #include <linux/clk.h>
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
+#include <linux/clk-provider.h>
 #include <linux/err.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
@@ -234,7 +235,7 @@ static void __init sp804_of_init(struct device_node *np)
 		clk1 = NULL;
 
 	/* Get the 2nd clock if the timer has 3 timer clocks */
-	if (of_count_phandle_with_args(np, "clocks", "#clock-cells") == 3) {
+	if (of_clk_get_parent_count(np) == 3) {
 		clk2 = of_clk_get(np, 1);
 		if (IS_ERR(clk2)) {
 			pr_err("sp804: %s clock not found: %d\n", np->name,
-- 
1.9.1




More information about the linux-arm-kernel mailing list