clk: ti: make use of of_clk_parent_fill helper function
authorDinh Nguyen <dinguyen@opensource.altera.com>
Tue, 7 Jul 2015 03:59:06 +0000 (22:59 -0500)
committerStephen Boyd <sboyd@codeaurora.org>
Tue, 28 Jul 2015 18:59:07 +0000 (11:59 -0700)
Use of_clk_parent_fill to fill in the parent clock names' array.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/ti/apll.c
drivers/clk/ti/composite.c
drivers/clk/ti/dpll.c
drivers/clk/ti/fapll.c
drivers/clk/ti/mux.c

index 594b759f02eeaa6141e20c93eb7b77d770fcd67c..de5a02dfd3260e27d9c7e36766bd922bde9ed422 100644 (file)
@@ -172,7 +172,6 @@ static void __init of_dra7_apll_setup(struct device_node *node)
        struct clk_hw_omap *clk_hw = NULL;
        struct clk_init_data *init = NULL;
        const char **parent_names = NULL;
-       int i;
 
        ad = kzalloc(sizeof(*ad), GFP_KERNEL);
        clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
@@ -197,8 +196,7 @@ static void __init of_dra7_apll_setup(struct device_node *node)
        if (!parent_names)
                goto cleanup;
 
-       for (i = 0; i < init->num_parents; i++)
-               parent_names[i] = of_clk_get_parent_name(node, i);
+       of_clk_parent_fill(node, parent_names, init->num_parents);
 
        init->parent_names = parent_names;
 
index 96f83cedb4b3ca6426d1351bd5db6bbcc292fb90..dbef218fe5ecd3ad64319700ac1b142d9c42a89c 100644 (file)
@@ -276,7 +276,6 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
        int num_parents;
        const char **parent_names;
        struct component_clk *clk;
-       int i;
 
        num_parents = of_clk_get_parent_count(node);
 
@@ -289,8 +288,7 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
        if (!parent_names)
                return -ENOMEM;
 
-       for (i = 0; i < num_parents; i++)
-               parent_names[i] = of_clk_get_parent_name(node, i);
+       of_clk_parent_fill(node, parent_names, num_parents);
 
        clk = kzalloc(sizeof(*clk), GFP_KERNEL);
        if (!clk) {
index 2aacf7a3bcaeb137e4e7bb973cea2874ff1aa6a7..49acdf23ad40e95036a474a93fa571e9bc896b57 100644 (file)
@@ -341,7 +341,6 @@ static void __init of_ti_dpll_setup(struct device_node *node,
        struct clk_init_data *init = NULL;
        const char **parent_names = NULL;
        struct dpll_data *dd = NULL;
-       int i;
        u8 dpll_mode = 0;
 
        dd = kzalloc(sizeof(*dd), GFP_KERNEL);
@@ -370,8 +369,7 @@ static void __init of_ti_dpll_setup(struct device_node *node,
        if (!parent_names)
                goto cleanup;
 
-       for (i = 0; i < init->num_parents; i++)
-               parent_names[i] = of_clk_get_parent_name(node, i);
+       of_clk_parent_fill(node, parent_names, init->num_parents);
 
        init->parent_names = parent_names;
 
index 730aa62454a2454f6a5311adbd16bfff57e366d2..b1c741b115025c4b0c8c55f4d722c3302229c17e 100644 (file)
@@ -558,8 +558,7 @@ static void __init ti_fapll_setup(struct device_node *node)
                goto free;
        }
 
-       parent_name[0] = of_clk_get_parent_name(node, 0);
-       parent_name[1] = of_clk_get_parent_name(node, 1);
+       of_clk_parent_fill(node, parent_name, 2);
        init->parent_names = parent_name;
 
        fd->clk_ref = of_clk_get(node, 0);
index 5cdeed538b08a2eec168de48a94399c11af33472..99fe27e8376bfec54b5728687481ab1970e71e0a 100644 (file)
@@ -190,7 +190,6 @@ static void of_mux_clk_setup(struct device_node *node)
        void __iomem *reg;
        int num_parents;
        const char **parent_names;
-       int i;
        u8 clk_mux_flags = 0;
        u32 mask = 0;
        u32 shift = 0;
@@ -205,8 +204,7 @@ static void of_mux_clk_setup(struct device_node *node)
        if (!parent_names)
                goto cleanup;
 
-       for (i = 0; i < num_parents; i++)
-               parent_names[i] = of_clk_get_parent_name(node, i);
+       of_clk_parent_fill(node, parent_names, num_parents);
 
        reg = ti_clk_get_reg_addr(node, 0);