[PATCH] powerpc: fsl: pci: Remove of_node_put() in fsl_pci_assign_primary()

Liang He windhl at 126.com
Tue Jul 5 21:51:03 AEST 2022


for_each_matching_node() will automatically increase and decrease
the refcount. As there is a reference escaped out into global
'fsl_pci_primary', we should not use of_node_put() anymore.

Fixes: 905e75c46dba ("powerpc/fsl-pci: Unify pci/pcie initialization code")
Signed-off-by: Liang He <windhl at 126.com>
---
 arch/powerpc/sysdev/fsl_pci.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 4c986c955951..d23a56276f42 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -1137,7 +1137,6 @@ void __init fsl_pci_assign_primary(void)
 	for_each_matching_node(np, pci_ids) {
 		if (of_device_is_available(np)) {
 			fsl_pci_primary = np;
-			of_node_put(np);
 			return;
 		}
 	}
-- 
2.25.1



More information about the Linuxppc-dev mailing list