Skip to content

Commit 8086459

Browse files
tmlindbebarino
authored andcommitted
clk: ti: Preserve node in ti_dt_clocks_register()
In preparation for making use of the clock-output-names, we want to keep node around in ti_dt_clocks_register(). This change should not needed as a fix currently. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20220204071449.16762-3-tony@atomide.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 78ab3a9 commit 8086459

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

drivers/clk/ti/clk.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ int ti_clk_setup_ll_ops(struct ti_clk_ll_ops *ops)
131131
void __init ti_dt_clocks_register(struct ti_dt_clk oclks[])
132132
{
133133
struct ti_dt_clk *c;
134-
struct device_node *node, *parent;
134+
struct device_node *node, *parent, *child;
135135
struct clk *clk;
136136
struct of_phandle_args clkspec;
137137
char buf[64];
@@ -171,10 +171,13 @@ void __init ti_dt_clocks_register(struct ti_dt_clk oclks[])
171171
node = of_find_node_by_name(NULL, buf);
172172
if (num_args && compat_mode) {
173173
parent = node;
174-
node = of_get_child_by_name(parent, "clock");
175-
if (!node)
176-
node = of_get_child_by_name(parent, "clk");
177-
of_node_put(parent);
174+
child = of_get_child_by_name(parent, "clock");
175+
if (!child)
176+
child = of_get_child_by_name(parent, "clk");
177+
if (child) {
178+
of_node_put(parent);
179+
node = child;
180+
}
178181
}
179182

180183
clkspec.np = node;

0 commit comments

Comments
 (0)