Commit 0b4e7f08 authored by Dinh Nguyen's avatar Dinh Nguyen Committed by Stephen Boyd

clk: st: 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>
Tested-by Gabriel Fernandez <gabriel.fernandez@st.com>
Cc: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 5f23eff7
...@@ -243,7 +243,7 @@ static const char ** __init flexgen_get_parents(struct device_node *np, ...@@ -243,7 +243,7 @@ static const char ** __init flexgen_get_parents(struct device_node *np,
int *num_parents) int *num_parents)
{ {
const char **parents; const char **parents;
int nparents, i; int nparents;
nparents = of_clk_get_parent_count(np); nparents = of_clk_get_parent_count(np);
if (WARN_ON(nparents <= 0)) if (WARN_ON(nparents <= 0))
...@@ -253,10 +253,8 @@ static const char ** __init flexgen_get_parents(struct device_node *np, ...@@ -253,10 +253,8 @@ static const char ** __init flexgen_get_parents(struct device_node *np,
if (!parents) if (!parents)
return NULL; return NULL;
for (i = 0; i < nparents; i++) *num_parents = of_clk_parent_fill(np, parents, nparents);
parents[i] = of_clk_get_parent_name(np, i);
*num_parents = nparents;
return parents; return parents;
} }
......
...@@ -24,7 +24,7 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np, ...@@ -24,7 +24,7 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np,
int *num_parents) int *num_parents)
{ {
const char **parents; const char **parents;
int nparents, i; int nparents;
nparents = of_clk_get_parent_count(np); nparents = of_clk_get_parent_count(np);
if (WARN_ON(nparents <= 0)) if (WARN_ON(nparents <= 0))
...@@ -34,10 +34,7 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np, ...@@ -34,10 +34,7 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np,
if (!parents) if (!parents)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
for (i = 0; i < nparents; i++) *num_parents = of_clk_parent_fill(np, parents, nparents);
parents[i] = of_clk_get_parent_name(np, i);
*num_parents = nparents;
return parents; return parents;
} }
......
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