There should be one single entry in the OF world, so that the way we
parse the DT is always the same. make sure this is the case by avoid
calling of_parse_phandle_with_args() from of_clk_get_parent_name(). This
is even more relevant as we currently fail to parse clock-ranges. As a
result, it seems to be safer to directly call of_parse_clkspec() there.

Suggested-by: Stephen Boyd <[email protected]>
Fixes: 4472287a3b2f5 ("clk: Introduce of_clk_get_hw_from_clkspec()")
Signed-off-by: Miquel Raynal (Schneider Electric) <[email protected]>
Reviewed-by: Brian Masney <[email protected]>
---
 drivers/clk/clk.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 7d63d81ebc09..dad4bac10ad4 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -5364,8 +5364,7 @@ const char *of_clk_get_parent_name(const struct 
device_node *np, int index)
        int count;
        struct clk *clk;
 
-       rc = of_parse_phandle_with_args(np, "clocks", "#clock-cells", index,
-                                       &clkspec);
+       rc = of_parse_clkspec(np, index, NULL, &clkspec);
        if (rc)
                return NULL;
 

-- 
2.54.0


Reply via email to