Re: [PATCH V8] powerpc/fsl-pci: Unify pci/pcie initialization code

From
Scott Wood <hidden>
Date
2012-08-21 00:56:49
Reply to
Scott Wood, 2012-08-20
On 08/20/2012 05:04 PM, Scott Wood wrote:
On 08/20/2012 05:06 AM, Jia Hongtao wrote:
quoted
@@ -842,38 +839,60 @@ void __devinit fsl_pci_init(void)
 			node = fsl_pci_primary;
 
 			if (of_match_node(pci_ids, node))
-				break;
+				return;
 		}
-	}
 
-	node = NULL;
-	for_each_node_by_type(node, "pci") {
-		if (of_match_node(pci_ids, node)) {
+		node = of_find_node_by_type(NULL, "pci");
+		if (of_match_node(pci_ids, node))
What if the node returned doesn't match?  If you're checking for this,
handle the else-case (even if just with an error message).
Or just use of_find_matching_node().

Also, we probably need to check of_device_is_available() here (like
fsl_add_bridge does), and move on to the next PCI bus if it's disabled.

-Scott
Thread (11 messages) 11 messages, 3 authors, last reply 2012-08-22
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help