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

Scott Wood scottwood at freescale.com
Tue Aug 21 10:56:40 EST 2012


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




More information about the Linuxppc-dev mailing list