All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/512x: Hold the reference returned by of_find_compatible_node
@ 2022-06-21  8:03 Liang He
  2022-09-09 12:07 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Liang He @ 2022-06-21  8:03 UTC (permalink / raw)
  To: agust, mpe, benh, paulus, linuxppc-dev, windhl

In mpc5121_clk_provide_migration_support(), we need to hold the
reference returned by of_find_compatible_node() and use it to call
of_node_put for refcount balance.

Signed-off-by: Liang He <windhl@126.com>
---
 arch/powerpc/platforms/512x/clock-commonclk.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/512x/clock-commonclk.c b/arch/powerpc/platforms/512x/clock-commonclk.c
index ca475462e95b..42abeba4f698 100644
--- a/arch/powerpc/platforms/512x/clock-commonclk.c
+++ b/arch/powerpc/platforms/512x/clock-commonclk.c
@@ -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)
 {
-
+	struct device_node *np;
 	/*
 	 * pre-enable those clock items which are not yet appropriately
 	 * acquired by their peripheral driver
@@ -970,7 +970,9 @@ static void __init mpc5121_clk_provide_migration_support(void)
 	 * unused and so it gets disabled
 	 */
 	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]);
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/512x: Hold the reference returned by of_find_compatible_node
  2022-06-21  8:03 [PATCH] powerpc/512x: Hold the reference returned by of_find_compatible_node Liang He
@ 2022-09-09 12:07 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2022-09-09 12:07 UTC (permalink / raw)
  To: linuxppc-dev, agust, paulus, Liang He, benh, mpe

On Tue, 21 Jun 2022 16:03:49 +0800, Liang He wrote:
> In mpc5121_clk_provide_migration_support(), we need to hold the
> reference returned by of_find_compatible_node() and use it to call
> of_node_put for refcount balance.
> 
> 

Applied to powerpc/next.

[1/1] powerpc/512x: Hold the reference returned by of_find_compatible_node
      https://git.kernel.org/powerpc/c/cc0dd82c18559184e009bef8d0353d008013a813

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-09 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21  8:03 [PATCH] powerpc/512x: Hold the reference returned by of_find_compatible_node Liang He
2022-09-09 12:07 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.