Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <[email protected]>
---
Cc: Christoph Niedermaier <[email protected]>
Cc: Dong Aisheng <[email protected]>
Cc: Hou Zhiqiang <[email protected]>
Cc: Michael Trimarchi <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Tim Harvey <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
 drivers/clk/clk-gate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index cef98720b69..256ff108991 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -149,7 +149,8 @@ struct clk *clk_register_gate(struct udevice *dev, const 
char *name,
        clk = &gate->clk;
        clk->flags = flags;
 
-       ret = clk_register(clk, UBOOT_DM_CLK_GATE, name, parent_name);
+       ret = clk_register(clk, UBOOT_DM_CLK_GATE, name,
+               clk_resolve_parent_clk(dev, parent_name));
        if (ret) {
                kfree(gate);
                return ERR_PTR(ret);
-- 
2.47.2

Reply via email to