Commit cc0dd82c authored by Liang He's avatar Liang He Committed by Michael Ellerman

powerpc/512x: Add missing of_node_put() in clock-commonclk.c

In mpc5121_clk_provide_migration_support(), hold the reference returned
by of_find_compatible_node() and use it to call of_node_put() for refcount
balance.
Signed-off-by: default avatarLiang He <windhl@126.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220621080349.4081689-1-windhl@126.com
parent a3a4c10a
...@@ -950,7 +950,7 @@ static void __init mpc5121_clk_register_of_provider(struct device_node *np) ...@@ -950,7 +950,7 @@ static void __init mpc5121_clk_register_of_provider(struct device_node *np)
*/ */
static void __init mpc5121_clk_provide_migration_support(void) static void __init mpc5121_clk_provide_migration_support(void)
{ {
struct device_node *np;
/* /*
* pre-enable those clock items which are not yet appropriately * pre-enable those clock items which are not yet appropriately
* acquired by their peripheral driver * acquired by their peripheral driver
...@@ -970,7 +970,9 @@ static void __init mpc5121_clk_provide_migration_support(void) ...@@ -970,7 +970,9 @@ static void __init mpc5121_clk_provide_migration_support(void)
* unused and so it gets disabled * unused and so it gets disabled
*/ */
clk_prepare_enable(clks[MPC512x_CLK_PSC3_MCLK]);/* serial console */ clk_prepare_enable(clks[MPC512x_CLK_PSC3_MCLK]);/* serial console */
if (of_find_compatible_node(NULL, "pci", "fsl,mpc5121-pci")) np = of_find_compatible_node(NULL, "pci", "fsl,mpc5121-pci");
of_node_put(np);
if (np)
clk_prepare_enable(clks[MPC512x_CLK_PCI]); clk_prepare_enable(clks[MPC512x_CLK_PCI]);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment