Skip to contentSkip to conversation

powerpc: chrp: Use device_type helpers to access the node type

PATCH In review Guenter Roeck 2 participants 2 messages Jan 19, 2019 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc: chrp: Use device_type helpers to access the node type

The node type can no longer be accessed directly, resulting in the following build error. Use accessor function instead.

arch/powerpc/platforms/chrp/setup.c: In function ‘chrp_init_IRQ’:
arch/powerpc/platforms/chrp/setup.c:541:33: error:
‘struct device_node’ has no member named ‘type’

Fixes 8ce5f8415753 ("of: Remove struct device_node.type pointer")
Cc Rob Herring <[email protected]>

---
v2: of_node_is_type() checks if the node pointer is NULL, so there is
no need to check it before calling the function.

 arch/powerpc/platforms/chrp/setup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/platforms/chrp/setup.c +1 -2
index e66644e0fb40..9438fa0fc355 100644
@@ -538,8 +538,7 @@ static void __init chrp_init_IRQ(void)
 	/* see if there is a keyboard in the device tree
 	   with a parent of type "adb" */
 	for_each_node_by_name(kbd, "keyboard")
-		if (kbd->parent && kbd->parent->type
-		    && strcmp(kbd->parent->type, "adb") == 0)
+		if (of_node_is_type(kbd->parent, "adb"))
 			break;
 	of_node_put(kbd);
 	if (kbd)
Signature · 1 line
2.7.4
#1 lore raw
Quoted 11 lines · Guenter Roeck

The node type can no longer be accessed directly, resulting in the following build error. Use accessor function instead.

arch/powerpc/platforms/chrp/setup.c: In function ‘chrp_init_IRQ’:
arch/powerpc/platforms/chrp/setup.c:541:33: error:
‘struct device_node’ has no member named ‘type’

Fixes 8ce5f8415753 ("of: Remove struct device_node.type pointer")
Cc Rob Herring <[email protected]>
Quoted 6 lines

---
v2: of_node_is_type() checks if the node pointer is NULL, so there is
no need to check it before calling the function.

 arch/powerpc/platforms/chrp/setup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Already have the same patch acked by Michael and am sending to Linus shortly.

Rob