clk: at91: Use of_clk_get_parent_count() instead of open coding
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 29 May 2015 09:25:45 +0000 (11:25 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Thu, 4 Jun 2015 20:51:23 +0000 (13:51 -0700)
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/at91/clk-main.c
drivers/clk/at91/clk-master.c
drivers/clk/at91/clk-programmable.c
drivers/clk/at91/clk-slow.c
drivers/clk/at91/clk-smd.c
drivers/clk/at91/clk-usb.c

index 59fa3cc96c9eb3411691970c63799996613dc8fe..c2400456a04471186ec210d8236951d9e4780901 100644 (file)
@@ -614,7 +614,7 @@ void __init of_at91sam9x5_clk_main_setup(struct device_node *np,
        const char *name = np->name;
        int i;
 
-       num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+       num_parents = of_clk_get_parent_count(np);
        if (num_parents <= 0 || num_parents > 2)
                return;
 
index c1af80bcdf2082c8d0d7b32e28eb9122c59ac53f..f98eafe9b12dc92d1c68f99cd5d9cc86addfb75f 100644 (file)
@@ -224,7 +224,7 @@ of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc,
        const char *name = np->name;
        struct clk_master_characteristics *characteristics;
 
-       num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+       num_parents = of_clk_get_parent_count(np);
        if (num_parents <= 0 || num_parents > MASTER_SOURCE_MAX)
                return;
 
index 86c8a073dcc32a20b98f4c862d5622b11ffe1d57..8c86c0f7847a55a0cdc257289c49c67777216d73 100644 (file)
@@ -237,7 +237,7 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc,
        const char *name;
        struct device_node *progclknp;
 
-       num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+       num_parents = of_clk_get_parent_count(np);
        if (num_parents <= 0 || num_parents > PROG_SOURCE_MAX)
                return;
 
index 2f13bd5246b5563ec399058029fcd0740c58c3d2..98a84a865fe1cf1b13a437741631b83804e32bf6 100644 (file)
@@ -373,7 +373,7 @@ void __init of_at91sam9x5_clk_slow_setup(struct device_node *np,
        const char *name = np->name;
        int i;
 
-       num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+       num_parents = of_clk_get_parent_count(np);
        if (num_parents <= 0 || num_parents > 2)
                return;
 
@@ -451,7 +451,7 @@ void __init of_at91sam9260_clk_slow_setup(struct device_node *np,
        const char *name = np->name;
        int i;
 
-       num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+       num_parents = of_clk_get_parent_count(np);
        if (num_parents != 2)
                return;
 
index 144d47ecfe63c6eb5dd383e2b396e4c59471244f..3817ea865ca258ecb8675f6e35c39be4f53fd424 100644 (file)
@@ -150,7 +150,7 @@ void __init of_at91sam9x5_clk_smd_setup(struct device_node *np,
        const char *parent_names[SMD_SOURCE_MAX];
        const char *name = np->name;
 
-       num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+       num_parents = of_clk_get_parent_count(np);
        if (num_parents <= 0 || num_parents > SMD_SOURCE_MAX)
                return;
 
index 0b7c3e8840bae0ebf2c97cf276e44e8ab7116f6e..b0cbd2b1ff5957027a5643963d45038435e8b1ce 100644 (file)
@@ -378,7 +378,7 @@ void __init of_at91sam9x5_clk_usb_setup(struct device_node *np,
        const char *parent_names[USB_SOURCE_MAX];
        const char *name = np->name;
 
-       num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+       num_parents = of_clk_get_parent_count(np);
        if (num_parents <= 0 || num_parents > USB_SOURCE_MAX)
                return;