[PATCH V8] powerpc/fsl-pci: Unify pci/pcie initialization code
Jia Hongtao-B38951
B38951 at freescale.com
Tue Aug 21 13:27:12 EST 2012
> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Tuesday, August 21, 2012 8:57 AM
> To: Jia Hongtao-B38951
> Cc: linuxppc-dev at lists.ozlabs.org; Bradley Hughes
> Subject: Re: [PATCH V8] powerpc/fsl-pci: Unify pci/pcie initialization
> code
>
> 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
I agree with you, of_device_is_available should be test too.
- Hongtao.
More information about the Linuxppc-dev
mailing list