linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] powerpc: chrp: Use device_type helpers to access the node type
@ 2019-01-19 16:18 Guenter Roeck
  2019-01-19 16:30 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2019-01-19 16:18 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Rob Herring, linux-kernel, Paul Mackerras, linuxppc-dev, 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 <robh@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
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(-)

diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index e66644e0fb40..9438fa0fc355 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -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)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] powerpc: chrp: Use device_type helpers to access the node type
  2019-01-19 16:18 [PATCH v2] powerpc: chrp: Use device_type helpers to access the node type Guenter Roeck
@ 2019-01-19 16:30 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2019-01-19 16:30 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Paul Mackerras, linuxppc-dev, linux-kernel

On Sat, Jan 19, 2019 at 10:18 AM Guenter Roeck <linux@roeck-us.net> wrote:
>
> 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 <robh@kernel.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-19 16:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-19 16:18 [PATCH v2] powerpc: chrp: Use device_type helpers to access the node type Guenter Roeck
2019-01-19 16:30 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).