Skip to contentSkip to conversation

fdt: add support for the ePAPR "phandle" property

PATCH Superseded Timur Tabi 1 participant 1 message May 6, 2011

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH v2 1/2 fdt: add support for the ePAPR "phandle" property

The ePAPR specification says that phandle properties should be called "phandle", and not "linux,phandle". To facilitate the migration from "linux,phandle" to "phandle", we update some functions to support both properties.

---

Upstream libfdt already has the ePAPR changes, so would someone please pull in those changes?

 common/fdt_support.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
common/fdt_support.c +6 -0
index 496040b..85715ff 100644
@@ -1187,6 +1187,12 @@ int fdt_alloc_phandle(void *blob)
 
 	for (offset = fdt_next_node(blob, -1, NULL); offset >= 0;
 	     offset = fdt_next_node(blob, offset, NULL)) {
+		/* Check the ePAPR-compliant "phandle" property name */
+		val = fdt_getprop(blob, offset, "phandle", &len);
+		if (val)
+			phandle = max(*val, phandle);
+
+		/* Also check the deprecated "linux,phandle" property name */
 		val = fdt_getprop(blob, offset, "linux,phandle", &len);
 		if (val)
 			phandle = max(*val, phandle);
Signature · 1 line
1.7.3.4