]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drivers/of: fdt: Make ibm,phandle logic only happen on pseries
authorDaniel Palmer <daniel@thingy.jp>
Wed, 3 Jun 2026 15:18:09 +0000 (00:18 +0900)
committerRob Herring (Arm) <robh@kernel.org>
Thu, 4 Jun 2026 02:01:40 +0000 (21:01 -0500)
The "ibm,phandle" thing only seems to be needed on pseries
machines but everyone gets it so they get a string and a little
bit of useless code.

In __of_attach_node() the pseries specific part uses
IS_ENABLED(CONFIG_PPC_PSERIES) so do that here too.

Signed-off-by: Daniel Palmer <daniel@thingy.jp>
Link: https://patch.msgid.link/20260603151809.3256280-1-daniel@thingy.jp
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
drivers/of/fdt.c

index ba65e36e183cc032cb12209fc66362e76d350cdf..26f66046cc323c5672ad310e1d22023a2be533b5 100644 (file)
@@ -145,7 +145,7 @@ static void populate_properties(const void *blob,
                 * used in pSeries dynamic device tree
                 * stuff
                 */
-               if (!strcmp(pname, "ibm,phandle"))
+               if (IS_ENABLED(CONFIG_PPC_PSERIES) && !strcmp(pname, "ibm,phandle"))
                        np->phandle = be32_to_cpup(val);
 
                pp->name   = (char *)pname;