From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Date: Fri, 6 May 2011 12:56:33 -0500 Subject: [U-Boot] [PATCH 2/2] powerpc/85xx: add support the ePAPR "phandle" property In-Reply-To: <1304704593-9067-1-git-send-email-timur@freescale.com> References: <1304704593-9067-1-git-send-email-timur@freescale.com> Message-ID: <1304704593-9067-2-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 fdt_qportal() to support both properties. Signed-off-by: Timur Tabi --- arch/powerpc/cpu/mpc85xx/portals.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/cpu/mpc85xx/portals.c b/arch/powerpc/cpu/mpc85xx/portals.c index c014163..bb0ae70 100644 --- a/arch/powerpc/cpu/mpc85xx/portals.c +++ b/arch/powerpc/cpu/mpc85xx/portals.c @@ -151,8 +151,19 @@ static int fdt_qportal(void *blob, int off, int id, char *name, dev_handle = fdt_get_phandle(blob, dev_off); if (dev_handle <= 0) { dev_handle = fdt_alloc_phandle(blob); - fdt_setprop_cell(blob, dev_off, + ret = fdt_setprop_cell(blob, dev_off, + "phandle", dev_handle); + if (ret < 0) + return ret; + /* + * For now, also set the deprecated + * "linux,phandle" property, so that we don't + * break older kernels. + */ + ret = fdt_setprop_cell(blob, dev_off, "linux,phandle", dev_handle); + if (ret < 0) + return ret; } ret = fdt_setprop(blob, childoff, "dev-handle", -- 1.7.3.4