Skip to contentSkip to conversation

atm: Convert to using %pOFn instead of device_node.name

PATCH Applied Rob Herring 6 participants 11 messages Nov 16, 2018 – Dec 7, 2018

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atm: Convert to using %pOFn instead of device_node.name

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

---
 drivers/atm/fore200e.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/atm/fore200e.c +2 -2
index f55ffde877b5..14053e01a2cc 100644
@@ -754,8 +754,8 @@ static int fore200e_sba_proc_read(struct fore200e *fore200e, char *page)
 
 	regs = of_get_property(op->dev.of_node, "reg", NULL);
 
-	return sprintf(page, "   SBUS slot/device:\t\t%d/'%s'\n",
-		       (regs ? regs->which_io : 0), op->dev.of_node->name);
+	return sprintf(page, "   SBUS slot/device:\t\t%d/'%pOFn'\n",
+		       (regs ? regs->which_io : 0), op->dev.of_node);
 }
 
 static const struct fore200e_bus fore200e_sbus_ops = {
Signature · 1 line
2.19.1
#1 lore raw

PATCH 1/1 hwmon: ina3221: Convert to using %pOFn instead of device_node.name

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

---
 drivers/hwmon/ina3221.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/ina3221.c +4 -4
index d61688f04594..27abbc5b9d46 100644
@@ -469,10 +469,10 @@ static int ina3221_probe_child_from_dt(struct device *dev,
 
 	ret = of_property_read_u32(child, "reg", &val);
 	if (ret) {
-		dev_err(dev, "missing reg property of %s\n", child->name);
+		dev_err(dev, "missing reg property of %pOFn\n", child);
 		return ret;
 	} else if (val > INA3221_CHANNEL3) {
-		dev_err(dev, "invalid reg %d of %s\n", val, child->name);
+		dev_err(dev, "invalid reg %d of %pOFn\n", val, child);
 		return ret;
 	}
 
@@ -490,8 +490,8 @@ static int ina3221_probe_child_from_dt(struct device *dev,
 	/* Overwrite default shunt resistor value optionally */
 	if (!of_property_read_u32(child, "shunt-resistor-micro-ohms", &val)) {
 		if (val < 1 || val > INT_MAX) {
-			dev_err(dev, "invalid shunt resistor value %u of %s\n",
-				val, child->name);
+			dev_err(dev, "invalid shunt resistor value %u of %pOFn\n",
+				val, child);
 			return -EINVAL;
 		}
 		input->shunt_resistor = val;
Signature · 1 line
2.19.1
maintainer Applied
#2 lore raw

Re: [PATCH] hwmon: ina3221: Convert to using %pOFn instead of device_node.name

Quoted 7 lines · Rob Herring

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

Applied to hwmon-next.

Thanks,
Guenter

Quoted 32 lines
---
 drivers/hwmon/ina3221.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/ina3221.c +4 -4
index d61688f04594..27abbc5b9d46 100644
@@ -469,10 +469,10 @@ static int ina3221_probe_child_from_dt(struct device *dev,
 
 	ret = of_property_read_u32(child, "reg", &val);
 	if (ret) {
-		dev_err(dev, "missing reg property of %s\n", child->name);
+		dev_err(dev, "missing reg property of %pOFn\n", child);
 		return ret;
 	} else if (val > INA3221_CHANNEL3) {
-		dev_err(dev, "invalid reg %d of %s\n", val, child->name);
+		dev_err(dev, "invalid reg %d of %pOFn\n", val, child);
 		return ret;
 	}
 
@@ -490,8 +490,8 @@ static int ina3221_probe_child_from_dt(struct device *dev,
 	/* Overwrite default shunt resistor value optionally */
 	if (!of_property_read_u32(child, "shunt-resistor-micro-ohms", &val)) {
 		if (val < 1 || val > INT_MAX) {
-			dev_err(dev, "invalid shunt resistor value %u of %s\n",
-				val, child->name);
+			dev_err(dev, "invalid shunt resistor value %u of %pOFn\n",
+				val, child);
 			return -EINVAL;
 		}
 		input->shunt_resistor = val;
#3 lore raw

PATCH 1/1 macintosh: windfarm: Another convert to using %pOFn instead of device_node.name

In reply to Rob Herring

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.

---
 drivers/macintosh/windfarm_fcu_controls.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/macintosh/windfarm_fcu_controls.c +3 -3
index fab7a21e9577..2b3ca628a650 100644
@@ -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") ||
Signature · 1 line
2.19.1
#4 lore raw

Re: macintosh: windfarm: Another convert to using %pOFn instead of device_node.name

Quoted 9 lines · Rob Herring

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.

Applied to powerpc next, thanks.

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

cheers

#5 lore raw

PATCH 1/1 pinctrl: mediatek: Convert to using %pOFn instead of device_node.name

In reply to Rob Herring

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

Cc Sean Wang <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc linux-mediatek at lists.infradead.org
Cc linux-gpio at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
---
 drivers/pinctrl/mediatek/pinctrl-paris.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/mediatek/pinctrl-paris.c +2 -2
index d2179028f134..7ff5ffa88198 100644
@@ -419,8 +419,8 @@ static int mtk_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
 
 	pins = of_find_property(node, "pinmux", NULL);
 	if (!pins) {
-		dev_err(hw->dev, "missing pins property in node %s .\n",
-			node->name);
+		dev_err(hw->dev, "missing pins property in node %pOFn .\n",
+			node);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.19.1
maintainer Acked-by on v1 1/1
#6 lore raw

Re: [PATCH] pinctrl: mediatek: Convert to using %pOFn instead of device_node.name

Quoted 11 lines · Rob Herring

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

Cc Sean Wang <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc linux-mediatek at lists.infradead.org
Cc linux-gpio at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Quoted 22 lines
---
 drivers/pinctrl/mediatek/pinctrl-paris.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/mediatek/pinctrl-paris.c +2 -3
index d2179028f134..7ff5ffa88198 100644
@@ -419,8 +419,8 @@ static int mtk_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
 
        pins = of_find_property(node, "pinmux", NULL);
        if (!pins) {
-               dev_err(hw->dev, "missing pins property in node %s .\n",
-                       node->name);
+               dev_err(hw->dev, "missing pins property in node %pOFn .\n",
+                       node);
                return -EINVAL;
        }
 
--

2.19.1

#7 lore raw

Re: [PATCH] pinctrl: mediatek: Convert to using %pOFn instead of device_node.name

Quoted 14 lines · Sean Wang
Quoted 11 lines · Rob Herring

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

Cc Sean Wang <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc linux-mediatek at lists.infradead.org
Cc linux-gpio at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Quoted 1 line

BTW, messages to you bounce:

<[email protected]> (expanded from <[email protected]>): host
mailgw01.mediatek.com[216.200.240.184] said: 550 Relaying mail to sean.wang at mediatek.com is not allowed (in reply to RCPT TO command)

Perhaps you need your kernel.org account to route somewhere else.

Rob

maintainer
#8 lore raw

Re: [PATCH] pinctrl: mediatek: Convert to using %pOFn instead of device_node.name

Quoted 20 lines · Rob Herring
Quoted 14 lines · Sean Wang
Quoted 11 lines · Rob Herring

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

Cc Sean Wang <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc linux-mediatek at lists.infradead.org
Cc linux-gpio at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Quoted 1 line

BTW, messages to you bounce:

Quoted 7 lines

<[email protected]> (expanded from <[email protected]>): host
mailgw01.mediatek.com[216.200.240.184] said: 550 Relaying mail to sean.wang at mediatek.com is not allowed (in reply to RCPT TO command)

Perhaps you need your kernel.org account to route somewhere else.

Rob

Thanks. I've found the issue. Will fix it soon.

#9 lore raw

Re: [PATCH] pinctrl: mediatek: Convert to using %pOFn instead of device_node.name

In reply to Rob Herring
Quoted 10 lines · Rob Herring

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

Cc Sean Wang <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc linux-mediatek at lists.infradead.org
Cc linux-gpio at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org

Patch applied with Sean's ACK.

Yours,
Linus Walleij