From: Timur Tabi Date: Fri, 6 May 2011 14:56:37 -0500 Subject: [U-Boot] [PATCH 1/2] [v2] fdt: add support for the ePAPR "phandle" property Message-ID: <1304711797-10549-1-git-send-email-timur@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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. Signed-off-by: Timur Tabi --- 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(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 496040b..85715ff 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -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); -- 1.7.3.4