clk: socfpga: make use of of_clk_parent_fill helper function
Use of_clk_parent_fill to fill in the parent clock's array. Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
committed by
Stephen Boyd
parent
2e61dfb360
commit
761d3e328c
@@ -190,7 +190,6 @@ static void __init __socfpga_gate_init(struct device_node *node,
|
|||||||
const char *parent_name[SOCFPGA_MAX_PARENTS];
|
const char *parent_name[SOCFPGA_MAX_PARENTS];
|
||||||
struct clk_init_data init;
|
struct clk_init_data init;
|
||||||
int rc;
|
int rc;
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
socfpga_clk = kzalloc(sizeof(*socfpga_clk), GFP_KERNEL);
|
socfpga_clk = kzalloc(sizeof(*socfpga_clk), GFP_KERNEL);
|
||||||
if (WARN_ON(!socfpga_clk))
|
if (WARN_ON(!socfpga_clk))
|
||||||
@@ -234,12 +233,9 @@ static void __init __socfpga_gate_init(struct device_node *node,
|
|||||||
init.name = clk_name;
|
init.name = clk_name;
|
||||||
init.ops = ops;
|
init.ops = ops;
|
||||||
init.flags = 0;
|
init.flags = 0;
|
||||||
while (i < SOCFPGA_MAX_PARENTS && (parent_name[i] =
|
|
||||||
of_clk_get_parent_name(node, i)) != NULL)
|
|
||||||
i++;
|
|
||||||
|
|
||||||
|
init.num_parents = of_clk_parent_fill(node, parent_name, SOCFPGA_MAX_PARENTS);
|
||||||
init.parent_names = parent_name;
|
init.parent_names = parent_name;
|
||||||
init.num_parents = i;
|
|
||||||
socfpga_clk->hw.hw.init = &init;
|
socfpga_clk->hw.hw.init = &init;
|
||||||
|
|
||||||
clk = clk_register(NULL, &socfpga_clk->hw.hw);
|
clk = clk_register(NULL, &socfpga_clk->hw.hw);
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ static __init struct clk *__socfpga_pll_init(struct device_node *node,
|
|||||||
struct clk_init_data init;
|
struct clk_init_data init;
|
||||||
struct device_node *clkmgr_np;
|
struct device_node *clkmgr_np;
|
||||||
int rc;
|
int rc;
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
of_property_read_u32(node, "reg", ®);
|
of_property_read_u32(node, "reg", ®);
|
||||||
|
|
||||||
@@ -111,11 +110,7 @@ static __init struct clk *__socfpga_pll_init(struct device_node *node,
|
|||||||
init.ops = ops;
|
init.ops = ops;
|
||||||
init.flags = 0;
|
init.flags = 0;
|
||||||
|
|
||||||
while (i < SOCFPGA_MAX_PARENTS && (parent_name[i] =
|
init.num_parents = of_clk_parent_fill(node, parent_name, SOCFPGA_MAX_PARENTS);
|
||||||
of_clk_get_parent_name(node, i)) != NULL)
|
|
||||||
i++;
|
|
||||||
|
|
||||||
init.num_parents = i;
|
|
||||||
init.parent_names = parent_name;
|
init.parent_names = parent_name;
|
||||||
pll_clk->hw.hw.init = &init;
|
pll_clk->hw.hw.init = &init;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user