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

2 messages, 2 authors, 2013-01-14 · open the first message on its own page

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

From: Thierry Reding <hidden>
Date: 2012-12-20 08:25:00

On Wed, Dec 12, 2012 at 04:37:50PM +0000, Andrew Murray wrote:
[...]
quoted hunk
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

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

From: Andrew Murray <hidden>
Date: 2013-01-14 09:15:26

On Thu, Dec 20, 2012 at 08:25:00AM +0000, Thierry Reding wrote:
On Wed, Dec 12, 2012 at 04:37:50PM +0000, Andrew Murray wrote:
[...]
quoted
diff --git a/drivers/of/address.c b/drivers/of/address.c
[...]
quoted
+	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
Good catch. Thanks for taking this on.

Andrew Murray
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help