linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] macintosh: windfarm: Another convert to using %pOFn instead of device_node.name
       [not found] <20181116220540.17222-1-robh@kernel.org>
@ 2018-11-16 22:05 ` Rob Herring
  2018-12-07 13:07   ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2018-11-16 22:05 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: devicetree, linuxppc-dev, linux-kernel

In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Convert the open coded iterating thru child nodes to
for_each_child_of_node() while we're here.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/macintosh/windfarm_fcu_controls.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/macintosh/windfarm_fcu_controls.c b/drivers/macintosh/windfarm_fcu_controls.c
index fab7a21e9577..2b3ca628a650 100644
--- a/drivers/macintosh/windfarm_fcu_controls.c
+++ b/drivers/macintosh/windfarm_fcu_controls.c
@@ -425,18 +425,18 @@ static void wf_fcu_lookup_fans(struct wf_fcu_priv *pv)
 		{ "CPU B 2",		"cpu-fan-b-1",		},
 		{ "CPU B 3",		"cpu-fan-c-1",		},
 	};
-	struct device_node *np = NULL, *fcu = pv->i2c->dev.of_node;
+	struct device_node *np, *fcu = pv->i2c->dev.of_node;
 	int i;
 
 	DBG("Looking up FCU controls in device-tree...\n");
 
-	while ((np = of_get_next_child(fcu, np)) != NULL) {
+	for_each_child_of_node(fcu, np) {
 		int id, type = -1;
 		const char *loc;
 		const char *name;
 		const u32 *reg;
 
-		DBG(" control: %s, type: %s\n", np->name, np->type);
+		DBG(" control: %pOFn, type: %s\n", np, of_node_get_device_type(np));
 
 		/* Detect control type */
 		if (!strcmp(np->type, "fan-rpm-control") ||
-- 
2.19.1


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

* Re: macintosh: windfarm: Another convert to using %pOFn instead of device_node.name
  2018-11-16 22:05 ` [PATCH] macintosh: windfarm: Another convert to using %pOFn instead of device_node.name Rob Herring
@ 2018-12-07 13:07   ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-12-07 13:07 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree, linuxppc-dev, linux-kernel

On Fri, 2018-11-16 at 22:05:39 UTC, Rob Herring wrote:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
> 
> Convert the open coded iterating thru child nodes to
> for_each_child_of_node() while we're here.
> 
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/15b680c474afd54dac05530d8fed41

cheers

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

end of thread, other threads:[~2018-12-07 13:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20181116220540.17222-1-robh@kernel.org>
2018-11-16 22:05 ` [PATCH] macintosh: windfarm: Another convert to using %pOFn instead of device_node.name Rob Herring
2018-12-07 13:07   ` Michael Ellerman

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).