Skip to content

Commit

Permalink
clk: ti: Preserve node in ti_dt_clocks_register()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Stephen Boyd <[email protected]>
  • Loading branch information
tmlind authored and bebarino committed Mar 11, 2022
1 parent 78ab3a9 commit 8086459
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions drivers/clk/ti/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ int ti_clk_setup_ll_ops(struct ti_clk_ll_ops *ops)
void __init ti_dt_clocks_register(struct ti_dt_clk oclks[])
{
struct ti_dt_clk *c;
struct device_node *node, *parent;
struct device_node *node, *parent, *child;
struct clk *clk;
struct of_phandle_args clkspec;
char buf[64];
Expand Down Expand Up @@ -171,10 +171,13 @@ void __init ti_dt_clocks_register(struct ti_dt_clk oclks[])
node = of_find_node_by_name(NULL, buf);
if (num_args && compat_mode) {
parent = node;
node = of_get_child_by_name(parent, "clock");
if (!node)
node = of_get_child_by_name(parent, "clk");
of_node_put(parent);
child = of_get_child_by_name(parent, "clock");
if (!child)
child = of_get_child_by_name(parent, "clk");
if (child) {
of_node_put(parent);
node = child;
}
}

clkspec.np = node;
Expand Down

0 comments on commit 8086459

Please sign in to comment.