Commit 9da9e761 authored by Dinh Nguyen's avatar Dinh Nguyen Committed by Stephen Boyd

clk: ti: make use of of_clk_parent_fill helper function

Use of_clk_parent_fill to fill in the parent clock names' array.
Signed-off-by: default avatarDinh Nguyen <dinguyen@opensource.altera.com>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 8a53fb2b
...@@ -172,7 +172,6 @@ static void __init of_dra7_apll_setup(struct device_node *node) ...@@ -172,7 +172,6 @@ static void __init of_dra7_apll_setup(struct device_node *node)
struct clk_hw_omap *clk_hw = NULL; struct clk_hw_omap *clk_hw = NULL;
struct clk_init_data *init = NULL; struct clk_init_data *init = NULL;
const char **parent_names = NULL; const char **parent_names = NULL;
int i;
ad = kzalloc(sizeof(*ad), GFP_KERNEL); ad = kzalloc(sizeof(*ad), GFP_KERNEL);
clk_hw = kzalloc(sizeof(*clk_hw), 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) ...@@ -197,8 +196,7 @@ static void __init of_dra7_apll_setup(struct device_node *node)
if (!parent_names) if (!parent_names)
goto cleanup; goto cleanup;
for (i = 0; i < init->num_parents; i++) of_clk_parent_fill(node, parent_names, init->num_parents);
parent_names[i] = of_clk_get_parent_name(node, i);
init->parent_names = parent_names; init->parent_names = parent_names;
......
...@@ -276,7 +276,6 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw, ...@@ -276,7 +276,6 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
int num_parents; int num_parents;
const char **parent_names; const char **parent_names;
struct component_clk *clk; struct component_clk *clk;
int i;
num_parents = of_clk_get_parent_count(node); 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, ...@@ -289,8 +288,7 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
if (!parent_names) if (!parent_names)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < num_parents; i++) of_clk_parent_fill(node, parent_names, num_parents);
parent_names[i] = of_clk_get_parent_name(node, i);
clk = kzalloc(sizeof(*clk), GFP_KERNEL); clk = kzalloc(sizeof(*clk), GFP_KERNEL);
if (!clk) { if (!clk) {
......
...@@ -341,7 +341,6 @@ static void __init of_ti_dpll_setup(struct device_node *node, ...@@ -341,7 +341,6 @@ static void __init of_ti_dpll_setup(struct device_node *node,
struct clk_init_data *init = NULL; struct clk_init_data *init = NULL;
const char **parent_names = NULL; const char **parent_names = NULL;
struct dpll_data *dd = NULL; struct dpll_data *dd = NULL;
int i;
u8 dpll_mode = 0; u8 dpll_mode = 0;
dd = kzalloc(sizeof(*dd), GFP_KERNEL); dd = kzalloc(sizeof(*dd), GFP_KERNEL);
...@@ -370,8 +369,7 @@ static void __init of_ti_dpll_setup(struct device_node *node, ...@@ -370,8 +369,7 @@ static void __init of_ti_dpll_setup(struct device_node *node,
if (!parent_names) if (!parent_names)
goto cleanup; goto cleanup;
for (i = 0; i < init->num_parents; i++) of_clk_parent_fill(node, parent_names, init->num_parents);
parent_names[i] = of_clk_get_parent_name(node, i);
init->parent_names = parent_names; init->parent_names = parent_names;
......
...@@ -558,8 +558,7 @@ static void __init ti_fapll_setup(struct device_node *node) ...@@ -558,8 +558,7 @@ static void __init ti_fapll_setup(struct device_node *node)
goto free; goto free;
} }
parent_name[0] = of_clk_get_parent_name(node, 0); of_clk_parent_fill(node, parent_name, 2);
parent_name[1] = of_clk_get_parent_name(node, 1);
init->parent_names = parent_name; init->parent_names = parent_name;
fd->clk_ref = of_clk_get(node, 0); fd->clk_ref = of_clk_get(node, 0);
......
...@@ -190,7 +190,6 @@ static void of_mux_clk_setup(struct device_node *node) ...@@ -190,7 +190,6 @@ static void of_mux_clk_setup(struct device_node *node)
void __iomem *reg; void __iomem *reg;
int num_parents; int num_parents;
const char **parent_names; const char **parent_names;
int i;
u8 clk_mux_flags = 0; u8 clk_mux_flags = 0;
u32 mask = 0; u32 mask = 0;
u32 shift = 0; u32 shift = 0;
...@@ -205,8 +204,7 @@ static void of_mux_clk_setup(struct device_node *node) ...@@ -205,8 +204,7 @@ static void of_mux_clk_setup(struct device_node *node)
if (!parent_names) if (!parent_names)
goto cleanup; goto cleanup;
for (i = 0; i < num_parents; i++) of_clk_parent_fill(node, parent_names, num_parents);
parent_names[i] = of_clk_get_parent_name(node, i);
reg = ti_clk_get_reg_addr(node, 0); reg = ti_clk_get_reg_addr(node, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment