2018-11-16 22:08:43

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] 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.

Cc: Chas Williams <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/atm/fore200e.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index f55ffde877b5..14053e01a2cc 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -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 = {
--
2.19.1



2018-11-16 22:07:02

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] pinctrl: mediatek: 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.

Cc: Sean Wang <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/pinctrl/mediatek/pinctrl-paris.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
index d2179028f134..7ff5ffa88198 100644
--- a/drivers/pinctrl/mediatek/pinctrl-paris.c
+++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
@@ -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


2018-11-16 22:07:02

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] 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.

Cc: Jean Delvare <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/hwmon/ina3221.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c
index d61688f04594..27abbc5b9d46 100644
--- a/drivers/hwmon/ina3221.c
+++ b/drivers/hwmon/ina3221.c
@@ -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;
--
2.19.1


2018-11-16 22:07:02

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] macintosh: windfarm: Another 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.

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

Cc: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
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


2018-11-16 23:48:28

by Sean Wang

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

On Fri, Nov 16, 2018 at 2:06 PM Rob Herring <[email protected]> wrote:
>
> 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: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Acked-by: Sean Wang <[email protected]>

> ---
> drivers/pinctrl/mediatek/pinctrl-paris.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
> index d2179028f134..7ff5ffa88198 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-paris.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
> @@ -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
>

2018-11-18 05:54:07

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] atm: Convert to using %pOFn instead of device_node.name

From: Rob Herring <[email protected]>
Date: Fri, 16 Nov 2018 16:05:37 -0600

> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
>
> Cc: Chas Williams <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Applied to net-next.

2018-11-18 22:44:48

by Guenter Roeck

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

On Fri, Nov 16, 2018 at 04:05:38PM -0600, Rob Herring wrote:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
>
> Cc: Jean Delvare <[email protected]>
> Cc: Guenter Roeck <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Applied to hwmon-next.

Thanks,
Guenter

> ---
> drivers/hwmon/ina3221.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c
> index d61688f04594..27abbc5b9d46 100644
> --- a/drivers/hwmon/ina3221.c
> +++ b/drivers/hwmon/ina3221.c
> @@ -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;

2018-11-19 14:16:19

by Linus Walleij

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

On Fri, Nov 16, 2018 at 11:06 PM Rob Herring <[email protected]> wrote:

> 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: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Patch applied with Sean's ACK.

Yours,
Linus Walleij

2018-11-19 19:09:30

by Rob Herring (Arm)

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

On Fri, Nov 16, 2018 at 5:46 PM Sean Wang <[email protected]> wrote:
>
> On Fri, Nov 16, 2018 at 2:06 PM Rob Herring <[email protected]> wrote:
> >
> > 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: [email protected]
> > Cc: [email protected]
> > Cc: [email protected]
> > Signed-off-by: Rob Herring <[email protected]>
>
> Acked-by: Sean Wang <[email protected]>

BTW, messages to you bounce:

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

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

Rob

2018-11-19 19:29:48

by Sean Wang

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

On Mon, Nov 19, 2018 at 11:07 AM Rob Herring <[email protected]> wrote:
>
> On Fri, Nov 16, 2018 at 5:46 PM Sean Wang <[email protected]> wrote:
> >
> > On Fri, Nov 16, 2018 at 2:06 PM Rob Herring <[email protected]> wrote:
> > >
> > > 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: [email protected]
> > > Cc: [email protected]
> > > Cc: [email protected]
> > > Signed-off-by: Rob Herring <[email protected]>
> >
> > Acked-by: Sean Wang <[email protected]>
>
> BTW, messages to you bounce:
>
> <[email protected]> (expanded from <[email protected]>): host
> mailgw01.mediatek.com[216.200.240.184] said: 550 Relaying mail to
> [email protected] 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.

2018-12-07 13:09:32

by Michael Ellerman

[permalink] [raw]
Subject: Re: macintosh: windfarm: Another convert to using %pOFn instead of device_node.name

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 <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Applied to powerpc next, thanks.

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

cheers