[PATCH] pci: Provide support for parsing PCI DT ranges property

Thierry Reding thierry.reding at avionic-design.de
Thu Dec 20 19:25:00 EST 2012


On Wed, Dec 12, 2012 at 04:37:50PM +0000, Andrew Murray wrote:
[...]
> diff --git a/drivers/of/address.c b/drivers/of/address.c
[...]
> +	start = of_get_property(node, "ranges", &rlen);
> +	if (start == NULL)
> +		return NULL;
> +
> +	end = start + rlen;

I'm currently rewriting large parts of the Tegra PCIe controller driver
and I'm trying to use this new API. This seems to work fine, except that
I think this line needs to be:

	end = start + rlen / sizeof(__be32);

Otherwise we'll try to process 4 times as many ranges as there are.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20121220/69adab05/attachment.sig>


More information about the devicetree-discuss mailing list