ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 18 Apr 2018 14:50:02 +0000 (16:50 +0200)
committerStephen Boyd <sboyd@kernel.org>
Wed, 2 May 2018 15:32:57 +0000 (08:32 -0700)
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clocksource/timer-sp804.c

index 3ac9dec9a03852f921070ecc0f992e10b5650e8f..e01222ea888ff9d2b9187e4b02c8c0daa9448b40 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_clk.h>
 #include <linux/of_irq.h>
 #include <linux/sched_clock.h>
 
@@ -245,7 +246,7 @@ static int __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,