Skip to content

Commit

Permalink
powerpc/prom_init: Generate "phandle" instead of "linux, phandle"
Browse files Browse the repository at this point in the history
When creating the boot-time FDT from an actual Open Firmware live
tree, let's generate "phandle" properties for the phandles instead
of the old deprecated "linux,phandle".

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[mpe: Unsplit warning printf()]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Benjamin Herrenschmidt authored and Michael Ellerman committed Oct 18, 2018
1 parent 2c51d97 commit f1f208e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions arch/powerpc/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -2410,14 +2410,11 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
has_phandle = 1;
}

/* Add a "linux,phandle" property if no "phandle" property already
* existed.
*/
/* Add a "phandle" property if none already exist */
if (!has_phandle) {
soff = dt_find_string("linux,phandle");
soff = dt_find_string("phandle");
if (soff == 0)
prom_printf("WARNING: Can't find string index for"
" <linux-phandle> node %s\n", path);
prom_printf("WARNING: Can't find string index for <phandle> node %s\n", path);
else {
dt_push_token(OF_DT_PROP, mem_start, mem_end);
dt_push_token(4, mem_start, mem_end);
Expand Down Expand Up @@ -2477,9 +2474,9 @@ static void __init flatten_device_tree(void)
dt_string_start = mem_start;
mem_start += 4; /* hole */

/* Add "linux,phandle" in there, we'll need it */
/* Add "phandle" in there, we'll need it */
namep = make_room(&mem_start, &mem_end, 16, 1);
strcpy(namep, "linux,phandle");
strcpy(namep, "phandle");
mem_start = (unsigned long)namep + strlen(namep) + 1;

/* Build string array */
Expand Down

0 comments on commit f1f208e

Please sign in to comment.