diff options
| author | Geert Uytterhoeven <geert+renesas@glider.be> | 2018-04-18 10:50:02 -0400 |
|---|---|---|
| committer | Stephen Boyd <sboyd@kernel.org> | 2018-05-02 11:32:57 -0400 |
| commit | b799cac753e3efa8c38e8e0061da36705aad1e27 (patch) | |
| tree | e23e8d7d198d9b907b554454674cb9b90215b8b6 /drivers/clocksource | |
| parent | eb06d6bbc45a7561de78a00fb17bfbb75893ee26 (diff) | |
ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding
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>
Diffstat (limited to 'drivers/clocksource')
| -rw-r--r-- | drivers/clocksource/timer-sp804.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/clocksource/timer-sp804.c b/drivers/clocksource/timer-sp804.c index 3ac9dec9a038..e01222ea888f 100644 --- a/drivers/clocksource/timer-sp804.c +++ b/drivers/clocksource/timer-sp804.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/io.h> | 27 | #include <linux/io.h> |
| 28 | #include <linux/of.h> | 28 | #include <linux/of.h> |
| 29 | #include <linux/of_address.h> | 29 | #include <linux/of_address.h> |
| 30 | #include <linux/of_clk.h> | ||
| 30 | #include <linux/of_irq.h> | 31 | #include <linux/of_irq.h> |
| 31 | #include <linux/sched_clock.h> | 32 | #include <linux/sched_clock.h> |
| 32 | 33 | ||
| @@ -245,7 +246,7 @@ static int __init sp804_of_init(struct device_node *np) | |||
| 245 | clk1 = NULL; | 246 | clk1 = NULL; |
| 246 | 247 | ||
| 247 | /* Get the 2nd clock if the timer has 3 timer clocks */ | 248 | /* Get the 2nd clock if the timer has 3 timer clocks */ |
| 248 | if (of_count_phandle_with_args(np, "clocks", "#clock-cells") == 3) { | 249 | if (of_clk_get_parent_count(np) == 3) { |
| 249 | clk2 = of_clk_get(np, 1); | 250 | clk2 = of_clk_get(np, 1); |
| 250 | if (IS_ERR(clk2)) { | 251 | if (IS_ERR(clk2)) { |
| 251 | pr_err("sp804: %s clock not found: %d\n", np->name, | 252 | pr_err("sp804: %s clock not found: %d\n", np->name, |
