Skip to contentSkip to conversation

drivers/of: fdt: Make ibm,phandle logic only happen on pseries

PATCH Applied Daniel Palmer 2 participants 2 messages Jun 3 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/of: fdt: Make ibm,phandle logic only happen on pseries

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.

---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/fdt.c +1 -1
index 82f7327c59ea..2260a7c0c494 100644
@@ -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;
Signature · 1 line
2.53.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Daniel Palmer

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.

Quoted 8 lines

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

---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks!