On Thu, May 02, 2013 at 12:21:37PM -0300, Kleber Sacilotto de Souza wrote: > Hi Tony, > > It seems Lucas' change is a bit incomplete and is not handling the reference > counter to > the device_node correctly. Is the following change what you had in mind?
Ahh Sorry I expected there would be a for_each_parent_of_node macro.
I did a quick grep and it seems that's not very common, so open coding
it should be fine.
>
> dn = pcibios_get_phb_of_node(bus);
> if (!dn)
> return 0;
>
> for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) {
> pcie_link_speed_stats = (const uint32_t *) of_get_property(pdn,
> "ibm,pcie-link-speed-stats", NULL);
> if (pcie_link_speed_stats)
> break;
> }
>
> of_node_put(pdn);
I think you need the of_node_put() in the body of the loop, otherwise
aren't you leaking refcounts?
Yours Tony
pgpvt7_8OFgEf.pgp
Description: PGP signature
_______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
