Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Tony Lindgren and committed by
Stephen Boyd
80864594 78ab3a9a

+8 -5
+8 -5
drivers/clk/ti/clk.c
··· 131 131 void __init ti_dt_clocks_register(struct ti_dt_clk oclks[]) 132 132 { 133 133 struct ti_dt_clk *c; 134 - struct device_node *node, *parent; 134 + struct device_node *node, *parent, *child; 135 135 struct clk *clk; 136 136 struct of_phandle_args clkspec; 137 137 char buf[64]; ··· 171 171 node = of_find_node_by_name(NULL, buf); 172 172 if (num_args && compat_mode) { 173 173 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 + } 178 181 } 179 182 180 183 clkspec.np = node;