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

- From: Scott Wood \<hidden\>
- Date: 2012-08-21 00:56:49 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2012/08/9470865
- Thread: https://ratatoskr.run/linuxppc-dev/2012/08/9470853/t.md

```text
On 08/20/2012 05:04 PM, Scott Wood wrote:
> On 08/20/2012 05:06 AM, Jia Hongtao wrote:
>> @@ -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
```
