diff options
author | Dinh Nguyen <dinguyen@opensource.altera.com> | 2016-02-22 22:52:46 +0100 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-02-22 23:17:37 +0100 |
commit | 56713da3ee5c6b0cf5b1881973b939250766a91b (patch) | |
tree | f44bdc536676e9cc64934dda0076bd3197b8b4cf /drivers/clk/socfpga/clk-gate-a10.c | |
parent | clk: ti: dpll: convert DPLL support code to use clk_hw instead of clk ptrs (diff) | |
download | linux-56713da3ee5c6b0cf5b1881973b939250766a91b.tar.xz linux-56713da3ee5c6b0cf5b1881973b939250766a91b.zip |
clk: socfpga: allow for multiple parents on Arria10 periph clocks
There are some Arria10 clocks of type "altr,socfpga-a10-perip-clk" that can
have multiple parents. Fix up the __socfpga_periph_init() to call
of_clk_parent_fill() that will return the appropriate number of parents.
Also, update __socfpga_gate_init() to call of_clk_parent_fill() helper
function.
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/socfpga/clk-gate-a10.c')
-rw-r--r-- | drivers/clk/socfpga/clk-gate-a10.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/clk/socfpga/clk-gate-a10.c b/drivers/clk/socfpga/clk-gate-a10.c index 1cebf253e8fd..c2d572748167 100644 --- a/drivers/clk/socfpga/clk-gate-a10.c +++ b/drivers/clk/socfpga/clk-gate-a10.c @@ -115,7 +115,6 @@ static void __init __socfpga_gate_init(struct device_node *node, const char *parent_name[SOCFPGA_MAX_PARENTS]; struct clk_init_data init; int rc; - int i = 0; socfpga_clk = kzalloc(sizeof(*socfpga_clk), GFP_KERNEL); if (WARN_ON(!socfpga_clk)) @@ -167,12 +166,9 @@ static void __init __socfpga_gate_init(struct device_node *node, init.name = clk_name; init.ops = ops; 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.num_parents = i; socfpga_clk->hw.hw.init = &init; clk = clk_register(NULL, &socfpga_clk->hw.hw); |