2018-08-28 01:56:41

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] ARM: omap: 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: "BenoĆ®t Cousson" <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/arm/mach-omap2/omap_hwmod.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 2ceffd85dd3d..b5757646355a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -738,7 +738,7 @@ static int __init _setup_clkctrl_provider(struct device_node *np)
provider->size = size | 0xff;
provider->node = np;

- pr_debug("%s: %s: %x...%x [+%x]\n", __func__, np->parent->name,
+ pr_debug("%pOF: %s: %x...%x [+%x]\n", __func__, np->parent,
provider->addr, provider->addr + provider->size,
provider->offset);

@@ -799,9 +799,9 @@ static struct clk *_lookup_clkctrl_clk(struct omap_hwmod *oh)

clk = of_clk_get_from_provider(&clkspec);

- pr_debug("%s: %s got %p (offset=%x, provider=%s)\n",
+ pr_debug("%s: %s got %p (offset=%x, provider=%pOFn)\n",
__func__, oh->name, clk, clkspec.args[0],
- provider->node->parent->name);
+ provider->node->parent);

return clk;
}
@@ -2107,8 +2107,8 @@ static int of_dev_find_hwmod(struct device_node *np,
if (res)
continue;
if (!strcmp(p, oh->name)) {
- pr_debug("omap_hwmod: dt %s[%i] uses hwmod %s\n",
- np->name, i, oh->name);
+ pr_debug("omap_hwmod: dt %pOFn[%i] uses hwmod %s\n",
+ np, i, oh->name);
return i;
}
}
@@ -2210,8 +2210,8 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
return -ENOENT;

if (nr_addr != 1 || nr_size != 1) {
- pr_err("%s: invalid range for %s->%s\n", __func__,
- oh->name, np->name);
+ pr_err("%s: invalid range for %s->%pOFn\n", __func__,
+ oh->name, np);
return -EINVAL;
}

@@ -2219,8 +2219,8 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
base = of_translate_address(np, ranges++);
size = be32_to_cpup(ranges);

- pr_debug("omap_hwmod: %s %s at 0x%llx size 0x%llx\n",
- oh->name, np->name, base, size);
+ pr_debug("omap_hwmod: %s %pOFn at 0x%llx size 0x%llx\n",
+ oh->name, np, base, size);

res->start = base;
res->end = base + size - 1;
@@ -2322,8 +2322,8 @@ static int __init _init(struct omap_hwmod *oh, void *data)
if (r)
pr_debug("omap_hwmod: %s missing dt data\n", oh->name);
else if (np && index)
- pr_warn("omap_hwmod: %s using broken dt data from %s\n",
- oh->name, np->name);
+ pr_warn("omap_hwmod: %s using broken dt data from %pOFn\n",
+ oh->name, np);

r = _init_mpu_rt_base(oh, NULL, index, np);
if (r < 0) {
--
2.17.1



2018-08-28 01:54:34

by Rob Herring (Arm)

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

Signed-off-by: Rob Herring <[email protected]>
---
drivers/bus/mvebu-mbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 70db4d5638a6..5b2a11a88951 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -1229,7 +1229,7 @@ mbus_parse_ranges(struct device_node *node,
tuple_len = (*cell_count) * sizeof(__be32);

if (ranges_len % tuple_len) {
- pr_warn("malformed ranges entry '%s'\n", node->name);
+ pr_warn("malformed ranges entry '%pOFn'\n", node);
return -EINVAL;
}
return 0;
--
2.17.1


2018-08-28 01:54:34

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] MIPS: 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: Ralf Baechle <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: James Hogan <[email protected]>
Cc: John Crispin <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/mips/cavium-octeon/octeon-irq.c | 16 ++++++++--------
arch/mips/netlogic/common/irq.c | 14 +++++++-------
arch/mips/ralink/cevt-rt3352.c | 6 +++---
arch/mips/ralink/ill_acc.c | 2 +-
4 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index 8272d8c648ca..cc1d8525e651 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -1180,8 +1180,8 @@ static int octeon_irq_gpio_xlat(struct irq_domain *d,
type = IRQ_TYPE_LEVEL_LOW;
break;
default:
- pr_err("Error: (%s) Invalid irq trigger specification: %x\n",
- node->name,
+ pr_err("Error: (%pOFn) Invalid irq trigger specification: %x\n",
+ node,
trigger);
type = IRQ_TYPE_LEVEL_LOW;
break;
@@ -2271,8 +2271,8 @@ static int __init octeon_irq_init_cib(struct device_node *ciu_node,

parent_irq = irq_of_parse_and_map(ciu_node, 0);
if (!parent_irq) {
- pr_err("ERROR: Couldn't acquire parent_irq for %s\n",
- ciu_node->name);
+ pr_err("ERROR: Couldn't acquire parent_irq for %pOFn\n",
+ ciu_node);
return -EINVAL;
}

@@ -2283,7 +2283,7 @@ static int __init octeon_irq_init_cib(struct device_node *ciu_node,

addr = of_get_address(ciu_node, 0, NULL, NULL);
if (!addr) {
- pr_err("ERROR: Couldn't acquire reg(0) %s\n", ciu_node->name);
+ pr_err("ERROR: Couldn't acquire reg(0) %pOFn\n", ciu_node);
return -EINVAL;
}
host_data->raw_reg = (u64)phys_to_virt(
@@ -2291,7 +2291,7 @@ static int __init octeon_irq_init_cib(struct device_node *ciu_node,

addr = of_get_address(ciu_node, 1, NULL, NULL);
if (!addr) {
- pr_err("ERROR: Couldn't acquire reg(1) %s\n", ciu_node->name);
+ pr_err("ERROR: Couldn't acquire reg(1) %pOFn\n", ciu_node);
return -EINVAL;
}
host_data->en_reg = (u64)phys_to_virt(
@@ -2299,8 +2299,8 @@ static int __init octeon_irq_init_cib(struct device_node *ciu_node,

r = of_property_read_u32(ciu_node, "cavium,max-bits", &val);
if (r) {
- pr_err("ERROR: Couldn't read cavium,max-bits from %s\n",
- ciu_node->name);
+ pr_err("ERROR: Couldn't read cavium,max-bits from %pOFn\n",
+ ciu_node);
return r;
}
host_data->max_bits = val;
diff --git a/arch/mips/netlogic/common/irq.c b/arch/mips/netlogic/common/irq.c
index f4961bc9a61d..cf33dd8a487e 100644
--- a/arch/mips/netlogic/common/irq.c
+++ b/arch/mips/netlogic/common/irq.c
@@ -291,7 +291,7 @@ static int __init xlp_of_pic_init(struct device_node *node,
/* we need a hack to get the PIC's SoC chip id */
ret = of_address_to_resource(node, 0, &res);
if (ret < 0) {
- pr_err("PIC %s: reg property not found!\n", node->name);
+ pr_err("PIC %pOFn: reg property not found!\n", node);
return -EINVAL;
}

@@ -304,21 +304,21 @@ static int __init xlp_of_pic_init(struct device_node *node,
break;
}
if (socid == NLM_NR_NODES) {
- pr_err("PIC %s: Node mapping for bus %d not found!\n",
- node->name, bus);
+ pr_err("PIC %pOFn: Node mapping for bus %d not found!\n",
+ node, bus);
return -EINVAL;
}
} else {
socid = (res.start >> 18) & 0x3;
if (!nlm_node_present(socid)) {
- pr_err("PIC %s: node %d does not exist!\n",
- node->name, socid);
+ pr_err("PIC %pOFn: node %d does not exist!\n",
+ node, socid);
return -EINVAL;
}
}

if (!nlm_node_present(socid)) {
- pr_err("PIC %s: node %d does not exist!\n", node->name, socid);
+ pr_err("PIC %pOFn: node %d does not exist!\n", node, socid);
return -EINVAL;
}

@@ -326,7 +326,7 @@ static int __init xlp_of_pic_init(struct device_node *node,
nlm_irq_to_xirq(socid, PIC_IRQ_BASE), PIC_IRQ_BASE,
&xlp_pic_irq_domain_ops, NULL);
if (xlp_pic_domain == NULL) {
- pr_err("PIC %s: Creating legacy domain failed!\n", node->name);
+ pr_err("PIC %pOFn: Creating legacy domain failed!\n", node);
return -EINVAL;
}
pr_info("Node %d: IRQ domain created for PIC@%pR\n", socid, &res);
diff --git a/arch/mips/ralink/cevt-rt3352.c b/arch/mips/ralink/cevt-rt3352.c
index 92f284d2b802..61a08943eb2f 100644
--- a/arch/mips/ralink/cevt-rt3352.c
+++ b/arch/mips/ralink/cevt-rt3352.c
@@ -134,7 +134,7 @@ static int __init ralink_systick_init(struct device_node *np)
systick.dev.min_delta_ticks = 0x3;
systick.dev.irq = irq_of_parse_and_map(np, 0);
if (!systick.dev.irq) {
- pr_err("%s: request_irq failed", np->name);
+ pr_err("%pOFn: request_irq failed", np);
return -EINVAL;
}

@@ -146,8 +146,8 @@ static int __init ralink_systick_init(struct device_node *np)

clockevents_register_device(&systick.dev);

- pr_info("%s: running - mult: %d, shift: %d\n",
- np->name, systick.dev.mult, systick.dev.shift);
+ pr_info("%pOFn: running - mult: %d, shift: %d\n",
+ np, systick.dev.mult, systick.dev.shift);

return 0;
}
diff --git a/arch/mips/ralink/ill_acc.c b/arch/mips/ralink/ill_acc.c
index 765d5ba98fa2..fc056f2acfeb 100644
--- a/arch/mips/ralink/ill_acc.c
+++ b/arch/mips/ralink/ill_acc.c
@@ -62,7 +62,7 @@ static int __init ill_acc_of_setup(void)

pdev = of_find_device_by_node(np);
if (!pdev) {
- pr_err("%s: failed to lookup pdev\n", np->name);
+ pr_err("%pOFn: failed to lookup pdev\n", np);
return -EINVAL;
}

--
2.17.1


2018-08-28 01:54:36

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] hwmon: 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/aspeed-pwm-tacho.c | 2 +-
drivers/hwmon/ibmpowernv.c | 4 ++--
drivers/hwmon/iio_hwmon.c | 9 ++++-----
drivers/hwmon/npcm750-pwm-fan.c | 2 +-
4 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c
index 5e449eac788a..92de8139d398 100644
--- a/drivers/hwmon/aspeed-pwm-tacho.c
+++ b/drivers/hwmon/aspeed-pwm-tacho.c
@@ -852,7 +852,7 @@ static int aspeed_create_pwm_cooling(struct device *dev,
dev_err(dev, "Property 'cooling-levels' cannot be read.\n");
return ret;
}
- snprintf(cdev->name, MAX_CDEV_NAME_LEN, "%s%d", child->name, pwm_port);
+ snprintf(cdev->name, MAX_CDEV_NAME_LEN, "%pOFn%d", child, pwm_port);

cdev->tcdev = thermal_of_cooling_device_register(child,
cdev->name,
diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
index 83472808c816..4935897f1527 100644
--- a/drivers/hwmon/ibmpowernv.c
+++ b/drivers/hwmon/ibmpowernv.c
@@ -603,8 +603,8 @@ static int create_device_attrs(struct platform_device *pdev)
if (of_property_read_u32(np, "sensor-id", &sensor_id) &&
of_property_read_u32(np, "sensor-data", &sensor_id)) {
dev_info(&pdev->dev,
- "'sensor-id' missing in the node '%s'\n",
- np->name);
+ "'sensor-id' missing in the node '%pOFn'\n",
+ np);
continue;
}

diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
index 2f3f875c06ac..7566991f1c04 100644
--- a/drivers/hwmon/iio_hwmon.c
+++ b/drivers/hwmon/iio_hwmon.c
@@ -65,13 +65,9 @@ static int iio_hwmon_probe(struct platform_device *pdev)
int in_i = 1, temp_i = 1, curr_i = 1, humidity_i = 1;
enum iio_chan_type type;
struct iio_channel *channels;
- const char *name = "iio_hwmon";
struct device *hwmon_dev;
char *sname;

- if (dev->of_node && dev->of_node->name)
- name = dev->of_node->name;
-
channels = devm_iio_channel_get_all(dev);
if (IS_ERR(channels)) {
if (PTR_ERR(channels) == -ENODEV)
@@ -141,7 +137,10 @@ static int iio_hwmon_probe(struct platform_device *pdev)
st->attr_group.attrs = st->attrs;
st->groups[0] = &st->attr_group;

- sname = devm_kstrdup(dev, name, GFP_KERNEL);
+ if (dev->of_node)
+ sname = devm_kasprintf(dev, GFP_KERNEL, "%pOFn", dev->of_node);
+ else
+ sname = devm_kstrdup(dev, "iio_hwmon", GFP_KERNEL);
if (!sname)
return -ENOMEM;

diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c
index 8474d601aa63..96634fd54e0b 100644
--- a/drivers/hwmon/npcm750-pwm-fan.c
+++ b/drivers/hwmon/npcm750-pwm-fan.c
@@ -861,7 +861,7 @@ static int npcm7xx_create_pwm_cooling(struct device *dev,
dev_err(dev, "Property 'cooling-levels' cannot be read.\n");
return ret;
}
- snprintf(cdev->name, THERMAL_NAME_LENGTH, "%s%d", child->name,
+ snprintf(cdev->name, THERMAL_NAME_LENGTH, "%pOFn%d", child,
pwm_port);

cdev->tcdev = thermal_of_cooling_device_register(child,
--
2.17.1


2018-08-28 01:54:35

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] clk: 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: Eugeniy Paltsev <[email protected]>
Cc: Michael Turquette <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/clk/axs10x/pll_clock.c | 4 ++--
drivers/clk/bcm/clk-kona-setup.c | 22 +++++++++++-----------
drivers/clk/clk-asm9260.c | 4 ++--
drivers/clk/clk-cdce925.c | 10 +++++-----
drivers/clk/clk-fixed-factor.c | 8 ++++----
drivers/clk/clk-gpio.c | 8 ++++----
drivers/clk/clk-hsdk-pll.c | 4 ++--
drivers/clk/clk-nomadik.c | 4 ++--
drivers/clk/clk-npcm7xx.c | 2 +-
drivers/clk/clk-palmas.c | 4 ++--
drivers/clk/clk-qoriq.c | 14 +++++++-------
drivers/clk/clk-scmi.c | 2 +-
drivers/clk/clk-scpi.c | 6 +++---
drivers/clk/clk-si5351.c | 4 ++--
drivers/clk/clk-stm32f4.c | 2 +-
drivers/clk/clk-stm32h7.c | 2 +-
drivers/clk/clk-stm32mp1.c | 2 +-
drivers/clk/clk-tango4.c | 10 +++++-----
drivers/clk/keystone/gate.c | 2 +-
drivers/clk/keystone/pll.c | 2 +-
drivers/clk/renesas/clk-div6.c | 12 ++++++------
drivers/clk/renesas/clk-emev2.c | 8 ++++----
drivers/clk/renesas/clk-mstp.c | 8 ++++----
drivers/clk/renesas/clk-r8a73a4.c | 4 ++--
drivers/clk/renesas/clk-r8a7740.c | 4 ++--
drivers/clk/renesas/clk-r8a7778.c | 4 ++--
drivers/clk/renesas/clk-r8a7779.c | 4 ++--
drivers/clk/renesas/clk-rcar-gen2.c | 4 ++--
drivers/clk/renesas/clk-rz.c | 4 ++--
drivers/clk/renesas/clk-sh73a0.c | 4 ++--
drivers/clk/st/clkgen-fsyn.c | 2 +-
drivers/clk/sunxi/clk-mod0.c | 6 +++---
drivers/clk/sunxi/clk-sun9i-core.c | 20 ++++++++++----------
drivers/clk/sunxi/clk-sunxi.c | 4 ++--
drivers/clk/ti/apll.c | 18 +++++++++---------
drivers/clk/ti/clk-dra7-atl.c | 4 ++--
drivers/clk/ti/clk.c | 10 +++++-----
drivers/clk/ti/clkctrl.c | 14 ++++++--------
drivers/clk/ti/composite.c | 14 +++++++-------
drivers/clk/ti/divider.c | 4 ++--
drivers/clk/ti/dpll.c | 12 ++++++------
drivers/clk/ti/fapll.c | 8 ++++----
drivers/clk/ti/fixed-factor.c | 4 ++--
drivers/clk/ti/gate.c | 2 +-
drivers/clk/ti/interface.c | 2 +-
drivers/clk/ti/mux.c | 4 ++--
drivers/clk/zynq/clkc.c | 4 ++--
47 files changed, 151 insertions(+), 153 deletions(-)

diff --git a/drivers/clk/axs10x/pll_clock.c b/drivers/clk/axs10x/pll_clock.c
index 25d8c240ddfb..c68dada97316 100644
--- a/drivers/clk/axs10x/pll_clock.c
+++ b/drivers/clk/axs10x/pll_clock.c
@@ -301,13 +301,13 @@ static void __init of_axs10x_pll_clk_setup(struct device_node *node)

ret = clk_hw_register(NULL, &pll_clk->hw);
if (ret) {
- pr_err("failed to register %s clock\n", node->name);
+ pr_err("failed to register %pOFn clock\n", node);
goto err_unmap_lock;
}

ret = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &pll_clk->hw);
if (ret) {
- pr_err("failed to add hw provider for %s clock\n", node->name);
+ pr_err("failed to add hw provider for %pOFn clock\n", node);
goto err_unregister_clk;
}

diff --git a/drivers/clk/bcm/clk-kona-setup.c b/drivers/clk/bcm/clk-kona-setup.c
index 281f4322355c..e65eeef9cbaf 100644
--- a/drivers/clk/bcm/clk-kona-setup.c
+++ b/drivers/clk/bcm/clk-kona-setup.c
@@ -808,29 +808,29 @@ void __init kona_dt_ccu_setup(struct ccu_data *ccu,

ret = of_address_to_resource(node, 0, &res);
if (ret) {
- pr_err("%s: no valid CCU registers found for %s\n", __func__,
- node->name);
+ pr_err("%s: no valid CCU registers found for %pOFn\n", __func__,
+ node);
goto out_err;
}

range = resource_size(&res);
if (range > (resource_size_t)U32_MAX) {
- pr_err("%s: address range too large for %s\n", __func__,
- node->name);
+ pr_err("%s: address range too large for %pOFn\n", __func__,
+ node);
goto out_err;
}

ccu->range = (u32)range;

if (!ccu_data_valid(ccu)) {
- pr_err("%s: ccu data not valid for %s\n", __func__, node->name);
+ pr_err("%s: ccu data not valid for %pOFn\n", __func__, node);
goto out_err;
}

ccu->base = ioremap(res.start, ccu->range);
if (!ccu->base) {
- pr_err("%s: unable to map CCU registers for %s\n", __func__,
- node->name);
+ pr_err("%s: unable to map CCU registers for %pOFn\n", __func__,
+ node);
goto out_err;
}
ccu->node = of_node_get(node);
@@ -848,16 +848,16 @@ void __init kona_dt_ccu_setup(struct ccu_data *ccu,

ret = of_clk_add_hw_provider(node, of_clk_kona_onecell_get, ccu);
if (ret) {
- pr_err("%s: error adding ccu %s as provider (%d)\n", __func__,
- node->name, ret);
+ pr_err("%s: error adding ccu %pOFn as provider (%d)\n", __func__,
+ node, ret);
goto out_err;
}

if (!kona_ccu_init(ccu))
- pr_err("Broadcom %s initialization had errors\n", node->name);
+ pr_err("Broadcom %pOFn initialization had errors\n", node);

return;
out_err:
kona_ccu_teardown(ccu);
- pr_err("Broadcom %s setup aborted\n", node->name);
+ pr_err("Broadcom %pOFn setup aborted\n", node);
}
diff --git a/drivers/clk/clk-asm9260.c b/drivers/clk/clk-asm9260.c
index 44b544157121..d571a00b5282 100644
--- a/drivers/clk/clk-asm9260.c
+++ b/drivers/clk/clk-asm9260.c
@@ -281,7 +281,7 @@ static void __init asm9260_acc_init(struct device_node *np)

base = of_io_request_and_map(np, 0, np->name);
if (IS_ERR(base))
- panic("%s: unable to map resource", np->name);
+ panic("%pOFn: unable to map resource", np);

/* register pll */
rate = (ioread32(base + HW_SYSPLLCTRL) & 0xffff) * 1000000;
@@ -292,7 +292,7 @@ static void __init asm9260_acc_init(struct device_node *np)
ref_clk, 0, rate, accuracy);

if (IS_ERR(hw))
- panic("%s: can't register REFCLK. Check DT!", np->name);
+ panic("%pOFn: can't register REFCLK. Check DT!", np);

for (n = 0; n < ARRAY_SIZE(asm9260_mux_clks); n++) {
const struct asm9260_mux_clock *mc = &asm9260_mux_clks[n];
diff --git a/drivers/clk/clk-cdce925.c b/drivers/clk/clk-cdce925.c
index 0a7e7d5a7506..49531a2a5436 100644
--- a/drivers/clk/clk-cdce925.c
+++ b/drivers/clk/clk-cdce925.c
@@ -669,8 +669,8 @@ static int cdce925_probe(struct i2c_client *client,

/* Register PLL clocks */
for (i = 0; i < data->chip_info->num_plls; ++i) {
- pll_clk_name[i] = kasprintf(GFP_KERNEL, "%s.pll%d",
- client->dev.of_node->name, i);
+ pll_clk_name[i] = kasprintf(GFP_KERNEL, "%pOFn.pll%d",
+ client->dev.of_node, i);
init.name = pll_clk_name[i];
data->pll[i].chip = data;
data->pll[i].hw.init = &init;
@@ -710,7 +710,7 @@ static int cdce925_probe(struct i2c_client *client,
init.flags = 0;
init.num_parents = 1;
init.parent_names = &parent_name; /* Mux Y1 to input */
- init.name = kasprintf(GFP_KERNEL, "%s.Y1", client->dev.of_node->name);
+ init.name = kasprintf(GFP_KERNEL, "%pOFn.Y1", client->dev.of_node);
data->clk[0].chip = data;
data->clk[0].hw.init = &init;
data->clk[0].index = 0;
@@ -727,8 +727,8 @@ static int cdce925_probe(struct i2c_client *client,
init.flags = CLK_SET_RATE_PARENT;
init.num_parents = 1;
for (i = 1; i < data->chip_info->num_outputs; ++i) {
- init.name = kasprintf(GFP_KERNEL, "%s.Y%d",
- client->dev.of_node->name, i+1);
+ init.name = kasprintf(GFP_KERNEL, "%pOFn.Y%d",
+ client->dev.of_node, i+1);
data->clk[i].chip = data;
data->clk[i].hw.init = &init;
data->clk[i].index = i;
diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index 20724abd38bd..ef0ca9414f37 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -158,14 +158,14 @@ static struct clk *_of_fixed_factor_clk_setup(struct device_node *node)
int ret;

if (of_property_read_u32(node, "clock-div", &div)) {
- pr_err("%s Fixed factor clock <%s> must have a clock-div property\n",
- __func__, node->name);
+ pr_err("%s Fixed factor clock <%pOFn> must have a clock-div property\n",
+ __func__, node);
return ERR_PTR(-EIO);
}

if (of_property_read_u32(node, "clock-mult", &mult)) {
- pr_err("%s Fixed factor clock <%s> must have a clock-mult property\n",
- __func__, node->name);
+ pr_err("%s Fixed factor clock <%pOFn> must have a clock-mult property\n",
+ __func__, node);
return ERR_PTR(-EIO);
}

diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
index 40af4fbab4d2..6a43ce420492 100644
--- a/drivers/clk/clk-gpio.c
+++ b/drivers/clk/clk-gpio.c
@@ -233,11 +233,11 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
if (IS_ERR(gpiod)) {
ret = PTR_ERR(gpiod);
if (ret == -EPROBE_DEFER)
- pr_debug("%s: %s: GPIOs not yet available, retry later\n",
- node->name, __func__);
+ pr_debug("%pOFn: %s: GPIOs not yet available, retry later\n",
+ node, __func__);
else
- pr_err("%s: %s: Can't get '%s' named GPIO property\n",
- node->name, __func__,
+ pr_err("%pOFn: %s: Can't get '%s' named GPIO property\n",
+ node, __func__,
gpio_name);
return ret;
}
diff --git a/drivers/clk/clk-hsdk-pll.c b/drivers/clk/clk-hsdk-pll.c
index c4ee280f454d..a47c2b600f20 100644
--- a/drivers/clk/clk-hsdk-pll.c
+++ b/drivers/clk/clk-hsdk-pll.c
@@ -390,13 +390,13 @@ static void __init of_hsdk_pll_clk_setup(struct device_node *node)

ret = clk_hw_register(NULL, &pll_clk->hw);
if (ret) {
- pr_err("failed to register %s clock\n", node->name);
+ pr_err("failed to register %pOFn clock\n", node);
goto err_unmap_spec_regs;
}

ret = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &pll_clk->hw);
if (ret) {
- pr_err("failed to add hw provider for %s clock\n", node->name);
+ pr_err("failed to add hw provider for %pOFn clock\n", node);
goto err_unmap_spec_regs;
}

diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c
index 13ad6d1e5090..84a24875c629 100644
--- a/drivers/clk/clk-nomadik.c
+++ b/drivers/clk/clk-nomadik.c
@@ -97,8 +97,8 @@ static void __init nomadik_src_init(void)
}
src_base = of_iomap(np, 0);
if (!src_base) {
- pr_err("%s: must have src parent node with REGS (%s)\n",
- __func__, np->name);
+ pr_err("%s: must have src parent node with REGS (%pOFn)\n",
+ __func__, np);
return;
}

diff --git a/drivers/clk/clk-npcm7xx.c b/drivers/clk/clk-npcm7xx.c
index 740af90a9508..afb0eb106953 100644
--- a/drivers/clk/clk-npcm7xx.c
+++ b/drivers/clk/clk-npcm7xx.c
@@ -549,7 +549,7 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)

ret = of_address_to_resource(clk_np, 0, &res);
if (ret) {
- pr_err("%s: failed to get resource, ret %d\n", clk_np->name,
+ pr_err("%pOFn: failed to get resource, ret %d\n", clk_np,
ret);
return;
}
diff --git a/drivers/clk/clk-palmas.c b/drivers/clk/clk-palmas.c
index 7f51c01085ab..e9612e7068e9 100644
--- a/drivers/clk/clk-palmas.c
+++ b/drivers/clk/clk-palmas.c
@@ -195,8 +195,8 @@ static void palmas_clks_get_clk_data(struct platform_device *pdev,
prop = PALMAS_EXT_CONTROL_NSLEEP;
break;
default:
- dev_warn(&pdev->dev, "%s: Invalid ext control option: %u\n",
- node->name, prop);
+ dev_warn(&pdev->dev, "%pOFn: Invalid ext control option: %u\n",
+ node, prop);
prop = 0;
break;
}
diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 3a1812f65e5d..4c30b6e799ed 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -945,8 +945,8 @@ static void __init core_mux_init(struct device_node *np)

rc = of_clk_add_provider(np, of_clk_src_simple_get, clk);
if (rc) {
- pr_err("%s: Couldn't register clk provider for node %s: %d\n",
- __func__, np->name, rc);
+ pr_err("%s: Couldn't register clk provider for node %pOFn: %d\n",
+ __func__, np, rc);
return;
}
}
@@ -1199,8 +1199,8 @@ static void __init legacy_pll_init(struct device_node *np, int idx)

rc = of_clk_add_provider(np, of_clk_src_onecell_get, onecell_data);
if (rc) {
- pr_err("%s: Couldn't register clk provider for node %s: %d\n",
- __func__, np->name, rc);
+ pr_err("%s: Couldn't register clk provider for node %pOFn: %d\n",
+ __func__, np, rc);
goto err_cell;
}

@@ -1360,7 +1360,7 @@ static void __init clockgen_init(struct device_node *np)
is_old_ls1021a = true;
}
if (!clockgen.regs) {
- pr_err("%s(): %s: of_iomap() failed\n", __func__, np->name);
+ pr_err("%s(): %pOFn: of_iomap() failed\n", __func__, np);
return;
}

@@ -1406,8 +1406,8 @@ static void __init clockgen_init(struct device_node *np)

ret = of_clk_add_provider(np, clockgen_clk_get, &clockgen);
if (ret) {
- pr_err("%s: Couldn't register clk provider for node %s: %d\n",
- __func__, np->name, ret);
+ pr_err("%s: Couldn't register clk provider for node %pOFn: %d\n",
+ __func__, np, ret);
}

return;
diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
index a985bf5e1ac6..a2287c770d5c 100644
--- a/drivers/clk/clk-scmi.c
+++ b/drivers/clk/clk-scmi.c
@@ -132,7 +132,7 @@ static int scmi_clocks_probe(struct scmi_device *sdev)

count = handle->clk_ops->count_get(handle);
if (count < 0) {
- dev_err(dev, "%s: invalid clock output count\n", np->name);
+ dev_err(dev, "%pOFn: invalid clock output count\n", np);
return -EINVAL;
}

diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c
index 25854722810e..d3ccc1cfccd5 100644
--- a/drivers/clk/clk-scpi.c
+++ b/drivers/clk/clk-scpi.c
@@ -207,7 +207,7 @@ static int scpi_clk_add(struct device *dev, struct device_node *np,

count = of_property_count_strings(np, "clock-output-names");
if (count < 0) {
- dev_err(dev, "%s: invalid clock output count\n", np->name);
+ dev_err(dev, "%pOFn: invalid clock output count\n", np);
return -EINVAL;
}

@@ -232,13 +232,13 @@ static int scpi_clk_add(struct device *dev, struct device_node *np,

if (of_property_read_string_index(np, "clock-output-names",
idx, &name)) {
- dev_err(dev, "invalid clock name @ %s\n", np->name);
+ dev_err(dev, "invalid clock name @ %pOFn\n", np);
return -EINVAL;
}

if (of_property_read_u32_index(np, "clock-indices",
idx, &val)) {
- dev_err(dev, "invalid clock index @ %s\n", np->name);
+ dev_err(dev, "invalid clock index @ %pOFn\n", np);
return -EINVAL;
}

diff --git a/drivers/clk/clk-si5351.c b/drivers/clk/clk-si5351.c
index 50e7c341e97e..8bdf91b56012 100644
--- a/drivers/clk/clk-si5351.c
+++ b/drivers/clk/clk-si5351.c
@@ -1215,8 +1215,8 @@ static int si5351_dt_parse(struct i2c_client *client,
/* per clkout properties */
for_each_child_of_node(np, child) {
if (of_property_read_u32(child, "reg", &num)) {
- dev_err(&client->dev, "missing reg property of %s\n",
- child->name);
+ dev_err(&client->dev, "missing reg property of %pOFn\n",
+ child);
goto put_child;
}

diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c
index 294850bdc195..cdaa567c8042 100644
--- a/drivers/clk/clk-stm32f4.c
+++ b/drivers/clk/clk-stm32f4.c
@@ -1433,7 +1433,7 @@ static void __init stm32f4_rcc_init(struct device_node *np)

base = of_iomap(np, 0);
if (!base) {
- pr_err("%s: unable to map resource\n", np->name);
+ pr_err("%pOFn: unable to map resource\n", np);
return;
}

diff --git a/drivers/clk/clk-stm32h7.c b/drivers/clk/clk-stm32h7.c
index d3271eca3779..0ea7261d15e0 100644
--- a/drivers/clk/clk-stm32h7.c
+++ b/drivers/clk/clk-stm32h7.c
@@ -1216,7 +1216,7 @@ static void __init stm32h7_rcc_init(struct device_node *np)
/* get RCC base @ from DT */
base = of_iomap(np, 0);
if (!base) {
- pr_err("%s: unable to map resource", np->name);
+ pr_err("%pOFn: unable to map resource", np);
goto err_free_clks;
}

diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c
index a907555b2a3d..4f48342bc280 100644
--- a/drivers/clk/clk-stm32mp1.c
+++ b/drivers/clk/clk-stm32mp1.c
@@ -2088,7 +2088,7 @@ static void stm32mp1_rcc_init(struct device_node *np)

base = of_iomap(np, 0);
if (!base) {
- pr_err("%s: unable to map resource", np->name);
+ pr_err("%pOFn: unable to map resource", np);
of_node_put(np);
return;
}
diff --git a/drivers/clk/clk-tango4.c b/drivers/clk/clk-tango4.c
index 34b22b7930fb..fe12a43f7a40 100644
--- a/drivers/clk/clk-tango4.c
+++ b/drivers/clk/clk-tango4.c
@@ -54,13 +54,13 @@ static void __init tango4_clkgen_setup(struct device_node *np)
const char *parent = of_clk_get_parent_name(np, 0);

if (!base)
- panic("%s: invalid address\n", np->name);
+ panic("%pOFn: invalid address\n", np);

if (readl(base + CPUCLK_DIV) & DIV_BYPASS)
- panic("%s: unsupported cpuclk setup\n", np->name);
+ panic("%pOFn: unsupported cpuclk setup\n", np);

if (readl(base + SYSCLK_DIV) & DIV_BYPASS)
- panic("%s: unsupported sysclk setup\n", np->name);
+ panic("%pOFn: unsupported sysclk setup\n", np);

writel(0x100, base + CPUCLK_DIV); /* disable frequency ramping */

@@ -77,9 +77,9 @@ static void __init tango4_clkgen_setup(struct device_node *np)
pp[3] = clk_register_fixed_factor(NULL, "sdio_clk", "cd6", 0, 1, 2);

if (IS_ERR(pp[0]) || IS_ERR(pp[1]) || IS_ERR(pp[2]) || IS_ERR(pp[3]))
- panic("%s: clk registration failed\n", np->name);
+ panic("%pOFn: clk registration failed\n", np);

if (of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data))
- panic("%s: clk provider registration failed\n", np->name);
+ panic("%pOFn: clk provider registration failed\n", np);
}
CLK_OF_DECLARE(tango4_clkgen, "sigma,tango4-clkgen", tango4_clkgen_setup);
diff --git a/drivers/clk/keystone/gate.c b/drivers/clk/keystone/gate.c
index aed5af23895b..def15db4eef0 100644
--- a/drivers/clk/keystone/gate.c
+++ b/drivers/clk/keystone/gate.c
@@ -245,7 +245,7 @@ static void __init of_psc_clk_init(struct device_node *node, spinlock_t *lock)
return;
}

- pr_err("%s: error registering clk %s\n", __func__, node->name);
+ pr_err("%s: error registering clk %pOFn\n", __func__, node);

unmap_domain:
iounmap(data->domain_base);
diff --git a/drivers/clk/keystone/pll.c b/drivers/clk/keystone/pll.c
index e7e840fb74ea..2b871fc91d56 100644
--- a/drivers/clk/keystone/pll.c
+++ b/drivers/clk/keystone/pll.c
@@ -219,7 +219,7 @@ static void __init _of_pll_clk_init(struct device_node *node, bool pllctrl)
}

out:
- pr_err("%s: error initializing pll %s\n", __func__, node->name);
+ pr_err("%s: error initializing pll %pOFn\n", __func__, node);
kfree(pll_data);
}

diff --git a/drivers/clk/renesas/clk-div6.c b/drivers/clk/renesas/clk-div6.c
index 9febbf42c3df..3ca4a047edc7 100644
--- a/drivers/clk/renesas/clk-div6.c
+++ b/drivers/clk/renesas/clk-div6.c
@@ -312,8 +312,8 @@ static void __init cpg_div6_clock_init(struct device_node *np)

num_parents = of_clk_get_parent_count(np);
if (num_parents < 1) {
- pr_err("%s: no parent found for %s DIV6 clock\n",
- __func__, np->name);
+ pr_err("%s: no parent found for %pOFn DIV6 clock\n",
+ __func__, np);
return;
}

@@ -324,8 +324,8 @@ static void __init cpg_div6_clock_init(struct device_node *np)

reg = of_iomap(np, 0);
if (reg == NULL) {
- pr_err("%s: failed to map %s DIV6 clock register\n",
- __func__, np->name);
+ pr_err("%s: failed to map %pOFn DIV6 clock register\n",
+ __func__, np);
goto error;
}

@@ -337,8 +337,8 @@ static void __init cpg_div6_clock_init(struct device_node *np)

clk = cpg_div6_register(clk_name, num_parents, parent_names, reg, NULL);
if (IS_ERR(clk)) {
- pr_err("%s: failed to register %s DIV6 clock (%ld)\n",
- __func__, np->name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn DIV6 clock (%ld)\n",
+ __func__, np, PTR_ERR(clk));
goto error;
}

diff --git a/drivers/clk/renesas/clk-emev2.c b/drivers/clk/renesas/clk-emev2.c
index a91825471c79..a587f63378b3 100644
--- a/drivers/clk/renesas/clk-emev2.c
+++ b/drivers/clk/renesas/clk-emev2.c
@@ -86,8 +86,8 @@ static void __init emev2_smu_clkdiv_init(struct device_node *np)
clk = clk_register_divider(NULL, np->name, parent_name, 0,
smu_base + reg[0], reg[1], 8, 0, &lock);
of_clk_add_provider(np, of_clk_src_simple_get, clk);
- clk_register_clkdev(clk, np->name, NULL);
- pr_debug("## %s %s %p\n", __func__, np->name, clk);
+ clk_register_clkdev(clk, np->full_name, NULL);
+ pr_debug("## %s %pOFn %p\n", __func__, np, clk);
}
CLK_OF_DECLARE(emev2_smu_clkdiv, "renesas,emev2-smu-clkdiv",
emev2_smu_clkdiv_init);
@@ -104,7 +104,7 @@ static void __init emev2_smu_gclk_init(struct device_node *np)
clk = clk_register_gate(NULL, np->name, parent_name, 0,
smu_base + reg[0], reg[1], 0, &lock);
of_clk_add_provider(np, of_clk_src_simple_get, clk);
- clk_register_clkdev(clk, np->name, NULL);
- pr_debug("## %s %s %p\n", __func__, np->name, clk);
+ clk_register_clkdev(clk, np->full_name, NULL);
+ pr_debug("## %s %pOFn %p\n", __func__, np, clk);
}
CLK_OF_DECLARE(emev2_smu_gclk, "renesas,emev2-smu-gclk", emev2_smu_gclk_init);
diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
index e82adcb16a52..b72c7344effa 100644
--- a/drivers/clk/renesas/clk-mstp.c
+++ b/drivers/clk/renesas/clk-mstp.c
@@ -239,8 +239,8 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
break;

if (clkidx >= MSTP_MAX_CLOCKS) {
- pr_err("%s: invalid clock %s %s index %u\n",
- __func__, np->name, name, clkidx);
+ pr_err("%s: invalid clock %pOFn %s index %u\n",
+ __func__, np, name, clkidx);
continue;
}

@@ -259,8 +259,8 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
*/
clk_register_clkdev(clks[clkidx], name, NULL);
} else {
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clks[clkidx]));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clks[clkidx]));
}
}

diff --git a/drivers/clk/renesas/clk-r8a73a4.c b/drivers/clk/renesas/clk-r8a73a4.c
index 7b903ce4c901..48e9f1e816ad 100644
--- a/drivers/clk/renesas/clk-r8a73a4.c
+++ b/drivers/clk/renesas/clk-r8a73a4.c
@@ -228,8 +228,8 @@ static void __init r8a73a4_cpg_clocks_init(struct device_node *np)

clk = r8a73a4_cpg_register_clock(np, cpg, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-r8a7740.c b/drivers/clk/renesas/clk-r8a7740.c
index a7a30d2eca41..da781640f88f 100644
--- a/drivers/clk/renesas/clk-r8a7740.c
+++ b/drivers/clk/renesas/clk-r8a7740.c
@@ -187,8 +187,8 @@ static void __init r8a7740_cpg_clocks_init(struct device_node *np)

clk = r8a7740_cpg_register_clock(np, cpg, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-r8a7778.c b/drivers/clk/renesas/clk-r8a7778.c
index 886a8380e912..9b964611e5b6 100644
--- a/drivers/clk/renesas/clk-r8a7778.c
+++ b/drivers/clk/renesas/clk-r8a7778.c
@@ -130,8 +130,8 @@ static void __init r8a7778_cpg_clocks_init(struct device_node *np)

clk = r8a7778_cpg_register_clock(np, cpg, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-r8a7779.c b/drivers/clk/renesas/clk-r8a7779.c
index 5adcca4656c3..10019145a912 100644
--- a/drivers/clk/renesas/clk-r8a7779.c
+++ b/drivers/clk/renesas/clk-r8a7779.c
@@ -164,8 +164,8 @@ static void __init r8a7779_cpg_clocks_init(struct device_node *np)
clk = r8a7779_cpg_register_clock(np, cpg, config,
plla_mult, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-rcar-gen2.c b/drivers/clk/renesas/clk-rcar-gen2.c
index bccd62f2cb09..06c015d43167 100644
--- a/drivers/clk/renesas/clk-rcar-gen2.c
+++ b/drivers/clk/renesas/clk-rcar-gen2.c
@@ -445,8 +445,8 @@ static void __init rcar_gen2_cpg_clocks_init(struct device_node *np)

clk = rcar_gen2_cpg_register_clock(np, cpg, config, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-rz.c b/drivers/clk/renesas/clk-rz.c
index ac2f86d626b6..8ac904912439 100644
--- a/drivers/clk/renesas/clk-rz.c
+++ b/drivers/clk/renesas/clk-rz.c
@@ -113,8 +113,8 @@ static void __init rz_cpg_clocks_init(struct device_node *np)

clk = rz_cpg_register_clock(np, cpg, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-sh73a0.c b/drivers/clk/renesas/clk-sh73a0.c
index bab33610eb6c..2f44e0dd7afa 100644
--- a/drivers/clk/renesas/clk-sh73a0.c
+++ b/drivers/clk/renesas/clk-sh73a0.c
@@ -206,8 +206,8 @@ static void __init sh73a0_cpg_clocks_init(struct device_node *np)

clk = sh73a0_cpg_register_clock(np, cpg, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/st/clkgen-fsyn.c b/drivers/clk/st/clkgen-fsyn.c
index a79d81985c4e..cfa000007622 100644
--- a/drivers/clk/st/clkgen-fsyn.c
+++ b/drivers/clk/st/clkgen-fsyn.c
@@ -936,7 +936,7 @@ static void __init st_of_quadfs_setup(struct device_node *np,
if (!clk_parent_name)
return;

- pll_name = kasprintf(GFP_KERNEL, "%s.pll", np->name);
+ pll_name = kasprintf(GFP_KERNEL, "%pOFn.pll", np);
if (!pll_name)
return;

diff --git a/drivers/clk/sunxi/clk-mod0.c b/drivers/clk/sunxi/clk-mod0.c
index a27c264cc9b4..fc0278a1acc7 100644
--- a/drivers/clk/sunxi/clk-mod0.c
+++ b/drivers/clk/sunxi/clk-mod0.c
@@ -140,8 +140,8 @@ static void __init sun9i_a80_mod0_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for mod0-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for mod0-clk: %pOFn\n",
+ node);
return;
}

@@ -306,7 +306,7 @@ static void __init sunxi_mmc_setup(struct device_node *node,

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Couldn't map the %s clock registers\n", node->name);
+ pr_err("Couldn't map the %pOFn clock registers\n", node);
return;
}

diff --git a/drivers/clk/sunxi/clk-sun9i-core.c b/drivers/clk/sunxi/clk-sun9i-core.c
index e9295c286d5d..7e21b2b10c94 100644
--- a/drivers/clk/sunxi/clk-sun9i-core.c
+++ b/drivers/clk/sunxi/clk-sun9i-core.c
@@ -88,8 +88,8 @@ static void __init sun9i_a80_pll4_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for a80-pll4-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for a80-pll4-clk: %pOFn\n",
+ node);
return;
}

@@ -142,8 +142,8 @@ static void __init sun9i_a80_gt_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for a80-gt-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for a80-gt-clk: %pOFn\n",
+ node);
return;
}

@@ -197,8 +197,8 @@ static void __init sun9i_a80_ahb_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for a80-ahb-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for a80-ahb-clk: %pOFn\n",
+ node);
return;
}

@@ -223,8 +223,8 @@ static void __init sun9i_a80_apb0_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for a80-apb0-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for a80-apb0-clk: %pOFn\n",
+ node);
return;
}

@@ -280,8 +280,8 @@ static void __init sun9i_a80_apb1_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for a80-apb1-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for a80-apb1-clk: %pOFn\n",
+ node);
return;
}

diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 012714d94b42..892c29030b7b 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -568,8 +568,8 @@ static struct clk * __init sunxi_factors_clk_setup(struct device_node *node,

reg = of_iomap(node, 0);
if (!reg) {
- pr_err("Could not get registers for factors-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for factors-clk: %pOFn\n",
+ node);
return NULL;
}

diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c
index 61c126a5d26a..222f68bc3f2a 100644
--- a/drivers/clk/ti/apll.c
+++ b/drivers/clk/ti/apll.c
@@ -143,8 +143,8 @@ static void __init omap_clk_register_apll(void *user,

clk = of_clk_get(node, 0);
if (IS_ERR(clk)) {
- pr_debug("clk-ref for %s not ready, retry\n",
- node->name);
+ pr_debug("clk-ref for %pOFn not ready, retry\n",
+ node);
if (!ti_clk_retry_init(node, hw, omap_clk_register_apll))
return;

@@ -155,8 +155,8 @@ static void __init omap_clk_register_apll(void *user,

clk = of_clk_get(node, 1);
if (IS_ERR(clk)) {
- pr_debug("clk-bypass for %s not ready, retry\n",
- node->name);
+ pr_debug("clk-bypass for %pOFn not ready, retry\n",
+ node);
if (!ti_clk_retry_init(node, hw, omap_clk_register_apll))
return;

@@ -202,7 +202,7 @@ static void __init of_dra7_apll_setup(struct device_node *node)

init->num_parents = of_clk_get_parent_count(node);
if (init->num_parents < 1) {
- pr_err("dra7 apll %s must have parent(s)\n", node->name);
+ pr_err("dra7 apll %pOFn must have parent(s)\n", node);
goto cleanup;
}

@@ -366,7 +366,7 @@ static void __init of_omap2_apll_setup(struct device_node *node)

init->num_parents = of_clk_get_parent_count(node);
if (init->num_parents != 1) {
- pr_err("%s must have one parent\n", node->name);
+ pr_err("%pOFn must have one parent\n", node);
goto cleanup;
}

@@ -374,13 +374,13 @@ static void __init of_omap2_apll_setup(struct device_node *node)
init->parent_names = &parent_name;

if (of_property_read_u32(node, "ti,clock-frequency", &val)) {
- pr_err("%s missing clock-frequency\n", node->name);
+ pr_err("%pOFn missing clock-frequency\n", node);
goto cleanup;
}
clk_hw->fixed_rate = val;

if (of_property_read_u32(node, "ti,bit-shift", &val)) {
- pr_err("%s missing bit-shift\n", node->name);
+ pr_err("%pOFn missing bit-shift\n", node);
goto cleanup;
}

@@ -389,7 +389,7 @@ static void __init of_omap2_apll_setup(struct device_node *node)
ad->autoidle_mask = 0x3 << val;

if (of_property_read_u32(node, "ti,idlest-shift", &val)) {
- pr_err("%s missing idlest-shift\n", node->name);
+ pr_err("%pOFn missing idlest-shift\n", node);
goto cleanup;
}

diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c
index 148815470431..a01ca9395179 100644
--- a/drivers/clk/ti/clk-dra7-atl.c
+++ b/drivers/clk/ti/clk-dra7-atl.c
@@ -190,8 +190,8 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)
init.num_parents = of_clk_get_parent_count(node);

if (init.num_parents != 1) {
- pr_err("%s: atl clock %s must have 1 parent\n", __func__,
- node->name);
+ pr_err("%s: atl clock %pOFn must have 1 parent\n", __func__,
+ node);
goto cleanup;
}

diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c
index 7d22e1af2247..be04214970cf 100644
--- a/drivers/clk/ti/clk.c
+++ b/drivers/clk/ti/clk.c
@@ -223,7 +223,7 @@ int __init ti_clk_retry_init(struct device_node *node, void *user,
{
struct clk_init_item *retry;

- pr_debug("%s: adding to retry list...\n", node->name);
+ pr_debug("%pOFn: adding to retry list...\n", node);
retry = kzalloc(sizeof(*retry), GFP_KERNEL);
if (!retry)
return -ENOMEM;
@@ -258,14 +258,14 @@ int ti_clk_get_reg_addr(struct device_node *node, int index,
}

if (i == CLK_MAX_MEMMAPS) {
- pr_err("clk-provider not found for %s!\n", node->name);
+ pr_err("clk-provider not found for %pOFn!\n", node);
return -ENOENT;
}

reg->index = i;

if (of_property_read_u32_index(node, "reg", index, &val)) {
- pr_err("%s must have reg[%d]!\n", node->name, index);
+ pr_err("%pOFn must have reg[%d]!\n", node, index);
return -EINVAL;
}

@@ -312,7 +312,7 @@ int __init omap2_clk_provider_init(struct device_node *parent, int index,
/* get clocks for this parent */
clocks = of_get_child_by_name(parent, "clocks");
if (!clocks) {
- pr_err("%s missing 'clocks' child node.\n", parent->name);
+ pr_err("%pOFn missing 'clocks' child node.\n", parent);
return -EINVAL;
}

@@ -365,7 +365,7 @@ void ti_dt_clk_init_retry_clks(void)

while (!list_empty(&retry_list) && retries) {
list_for_each_entry_safe(retry, tmp, &retry_list, link) {
- pr_debug("retry-init: %s\n", retry->node->name);
+ pr_debug("retry-init: %pOFn\n", retry->node);
retry->func(retry->user, retry->node);
list_del(&retry->link);
kfree(retry);
diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c
index 421b05392220..240e911a3db9 100644
--- a/drivers/clk/ti/clkctrl.c
+++ b/drivers/clk/ti/clkctrl.c
@@ -259,8 +259,8 @@ _ti_clkctrl_clk_register(struct omap_clkctrl_provider *provider,
struct omap_clkctrl_clk *clkctrl_clk;
int ret = 0;

- init.name = kasprintf(GFP_KERNEL, "%s:%s:%04x:%d", node->parent->name,
- node->name, offset, bit);
+ init.name = kasprintf(GFP_KERNEL, "%pOFn:%pOFn:%04x:%d", node->parent,
+ node, offset, bit);
clkctrl_clk = kzalloc(sizeof(*clkctrl_clk), GFP_KERNEL);
if (!init.name || !clkctrl_clk) {
ret = -ENOMEM;
@@ -492,8 +492,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)

provider->base = of_iomap(node, 0);

- provider->clkdm_name = kmalloc(strlen(node->parent->name) + 3,
- GFP_KERNEL);
+ provider->clkdm_name = kasprintf(GFP_KERNEL, "%pOFnxxx", node->parent);
if (!provider->clkdm_name) {
kfree(provider);
return;
@@ -503,8 +502,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
* Create default clkdm name, replace _cm from end of parent node
* name with _clkdm
*/
- strcpy(provider->clkdm_name, node->parent->name);
- provider->clkdm_name[strlen(provider->clkdm_name) - 2] = 0;
+ provider->clkdm_name[strlen(provider->clkdm_name) - 5] = 0;
strcat(provider->clkdm_name, "clkdm");

INIT_LIST_HEAD(&provider->clocks);
@@ -539,8 +537,8 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
init.flags = 0;
if (reg_data->flags & CLKF_SET_RATE_PARENT)
init.flags |= CLK_SET_RATE_PARENT;
- init.name = kasprintf(GFP_KERNEL, "%s:%s:%04x:%d",
- node->parent->name, node->name,
+ init.name = kasprintf(GFP_KERNEL, "%pOFn:%pOFn:%04x:%d",
+ node->parent, node,
reg_data->offset, 0);
clkctrl_clk = kzalloc(sizeof(*clkctrl_clk), GFP_KERNEL);
if (!init.name || !clkctrl_clk)
diff --git a/drivers/clk/ti/composite.c b/drivers/clk/ti/composite.c
index 030e8b2c1050..e76c81a62262 100644
--- a/drivers/clk/ti/composite.c
+++ b/drivers/clk/ti/composite.c
@@ -135,8 +135,8 @@ static void __init _register_composite(void *user,

comp = _lookup_component(cclk->comp_nodes[i]);
if (!comp) {
- pr_debug("component %s not ready for %s, retry\n",
- cclk->comp_nodes[i]->name, node->name);
+ pr_debug("component %s not ready for %pOFn, retry\n",
+ cclk->comp_nodes[i], node);
if (!ti_clk_retry_init(node, hw,
_register_composite))
return;
@@ -144,8 +144,8 @@ static void __init _register_composite(void *user,
goto cleanup;
}
if (cclk->comp_clks[comp->type] != NULL) {
- pr_err("duplicate component types for %s (%s)!\n",
- node->name, component_clk_types[comp->type]);
+ pr_err("duplicate component types for %pOFn (%s)!\n",
+ node, component_clk_types[comp->type]);
goto cleanup;
}

@@ -168,7 +168,7 @@ static void __init _register_composite(void *user,
}

if (!num_parents) {
- pr_err("%s: no parents found for %s!\n", __func__, node->name);
+ pr_err("%s: no parents found for %pOFn!\n", __func__, node);
goto cleanup;
}

@@ -212,7 +212,7 @@ static void __init of_ti_composite_clk_setup(struct device_node *node)
num_clks = of_clk_get_parent_count(node);

if (!num_clks) {
- pr_err("composite clk %s must have component(s)\n", node->name);
+ pr_err("composite clk %pOFn must have component(s)\n", node);
return;
}

@@ -248,7 +248,7 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
num_parents = of_clk_get_parent_count(node);

if (!num_parents) {
- pr_err("component-clock %s must have parent(s)\n", node->name);
+ pr_err("component-clock %pOFn must have parent(s)\n", node);
return -EINVAL;
}

diff --git a/drivers/clk/ti/divider.c b/drivers/clk/ti/divider.c
index ccfb4d9a152a..4fcb337a6d1c 100644
--- a/drivers/clk/ti/divider.c
+++ b/drivers/clk/ti/divider.c
@@ -492,7 +492,7 @@ __init ti_clk_get_div_table(struct device_node *node)
}

if (!valid_div) {
- pr_err("no valid dividers for %s table\n", node->name);
+ pr_err("no valid dividers for %pOFn table\n", node);
return ERR_PTR(-EINVAL);
}

@@ -530,7 +530,7 @@ static int _get_divider_width(struct device_node *node,
min_div = 1;

if (of_property_read_u32(node, "ti,max-div", &max_div)) {
- pr_err("no max-div for %s!\n", node->name);
+ pr_err("no max-div for %pOFn!\n", node);
return -EINVAL;
}

diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
index dc86d07d0921..2e80c5ead74a 100644
--- a/drivers/clk/ti/dpll.c
+++ b/drivers/clk/ti/dpll.c
@@ -162,8 +162,8 @@ static void __init _register_dpll(void *user,

clk = of_clk_get(node, 0);
if (IS_ERR(clk)) {
- pr_debug("clk-ref missing for %s, retry later\n",
- node->name);
+ pr_debug("clk-ref missing for %pOFn, retry later\n",
+ node);
if (!ti_clk_retry_init(node, hw, _register_dpll))
return;

@@ -175,8 +175,8 @@ static void __init _register_dpll(void *user,
clk = of_clk_get(node, 1);

if (IS_ERR(clk)) {
- pr_debug("clk-bypass missing for %s, retry later\n",
- node->name);
+ pr_debug("clk-bypass missing for %pOFn, retry later\n",
+ node);
if (!ti_clk_retry_init(node, hw, _register_dpll))
return;

@@ -226,7 +226,7 @@ static void _register_dpll_x2(struct device_node *node,

parent_name = of_clk_get_parent_name(node, 0);
if (!parent_name) {
- pr_err("%s must have parent\n", node->name);
+ pr_err("%pOFn must have parent\n", node);
return;
}

@@ -305,7 +305,7 @@ static void __init of_ti_dpll_setup(struct device_node *node,

init->num_parents = of_clk_get_parent_count(node);
if (!init->num_parents) {
- pr_err("%s must have parent(s)\n", node->name);
+ pr_err("%pOFn must have parent(s)\n", node);
goto cleanup;
}

diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c
index 071af44b1ba8..ed24f20f63c7 100644
--- a/drivers/clk/ti/fapll.c
+++ b/drivers/clk/ti/fapll.c
@@ -555,7 +555,7 @@ static void __init ti_fapll_setup(struct device_node *node)

init->num_parents = of_clk_get_parent_count(node);
if (init->num_parents != 2) {
- pr_err("%s must have two parents\n", node->name);
+ pr_err("%pOFn must have two parents\n", node);
goto free;
}

@@ -564,19 +564,19 @@ static void __init ti_fapll_setup(struct device_node *node)

fd->clk_ref = of_clk_get(node, 0);
if (IS_ERR(fd->clk_ref)) {
- pr_err("%s could not get clk_ref\n", node->name);
+ pr_err("%pOFn could not get clk_ref\n", node);
goto free;
}

fd->clk_bypass = of_clk_get(node, 1);
if (IS_ERR(fd->clk_bypass)) {
- pr_err("%s could not get clk_bypass\n", node->name);
+ pr_err("%pOFn could not get clk_bypass\n", node);
goto free;
}

fd->base = of_iomap(node, 0);
if (!fd->base) {
- pr_err("%s could not get IO base\n", node->name);
+ pr_err("%pOFn could not get IO base\n", node);
goto free;
}

diff --git a/drivers/clk/ti/fixed-factor.c b/drivers/clk/ti/fixed-factor.c
index 0174a51a4ba6..7cbe896db071 100644
--- a/drivers/clk/ti/fixed-factor.c
+++ b/drivers/clk/ti/fixed-factor.c
@@ -42,12 +42,12 @@ static void __init of_ti_fixed_factor_clk_setup(struct device_node *node)
u32 flags = 0;

if (of_property_read_u32(node, "ti,clock-div", &div)) {
- pr_err("%s must have a clock-div property\n", node->name);
+ pr_err("%pOFn must have a clock-div property\n", node);
return;
}

if (of_property_read_u32(node, "ti,clock-mult", &mult)) {
- pr_err("%s must have a clock-mult property\n", node->name);
+ pr_err("%pOFn must have a clock-mult property\n", node);
return;
}

diff --git a/drivers/clk/ti/gate.c b/drivers/clk/ti/gate.c
index 935b2de5fb88..d4b5638e8b99 100644
--- a/drivers/clk/ti/gate.c
+++ b/drivers/clk/ti/gate.c
@@ -179,7 +179,7 @@ static void __init _of_ti_gate_clk_setup(struct device_node *node,
}

if (of_clk_get_parent_count(node) != 1) {
- pr_err("%s must have 1 parent\n", node->name);
+ pr_err("%pOFn must have 1 parent\n", node);
return;
}

diff --git a/drivers/clk/ti/interface.c b/drivers/clk/ti/interface.c
index 41ae7021670e..87e00c2ee957 100644
--- a/drivers/clk/ti/interface.c
+++ b/drivers/clk/ti/interface.c
@@ -84,7 +84,7 @@ static void __init _of_ti_interface_clk_setup(struct device_node *node,

parent_name = of_clk_get_parent_name(node, 0);
if (!parent_name) {
- pr_err("%s must have a parent\n", node->name);
+ pr_err("%pOFn must have a parent\n", node);
return;
}

diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c
index 69a4308a5a98..18be7eb51546 100644
--- a/drivers/clk/ti/mux.c
+++ b/drivers/clk/ti/mux.c
@@ -186,7 +186,7 @@ static void of_mux_clk_setup(struct device_node *node)

num_parents = of_clk_get_parent_count(node);
if (num_parents < 2) {
- pr_err("mux-clock %s must have parents\n", node->name);
+ pr_err("mux-clock %pOFn must have parents\n", node);
return;
}
parent_names = kzalloc((sizeof(char *) * num_parents), GFP_KERNEL);
@@ -278,7 +278,7 @@ static void __init of_ti_composite_mux_clk_setup(struct device_node *node)
num_parents = of_clk_get_parent_count(node);

if (num_parents < 2) {
- pr_err("%s must have parents\n", node->name);
+ pr_err("%pOFn must have parents\n", node);
goto cleanup;
}

diff --git a/drivers/clk/zynq/clkc.c b/drivers/clk/zynq/clkc.c
index 88a2cab37f62..d7b53ac8ad11 100644
--- a/drivers/clk/zynq/clkc.c
+++ b/drivers/clk/zynq/clkc.c
@@ -602,7 +602,7 @@ void __init zynq_clock_init(void)
}

if (of_address_to_resource(np, 0, &res)) {
- pr_err("%s: failed to get resource\n", np->name);
+ pr_err("%pOFn: failed to get resource\n", np);
goto np_err;
}

@@ -611,7 +611,7 @@ void __init zynq_clock_init(void)
if (slcr->data) {
zynq_clkc_base = (__force void __iomem *)slcr->data + res.start;
} else {
- pr_err("%s: Unable to get I/O memory\n", np->name);
+ pr_err("%pOFn: Unable to get I/O memory\n", np);
of_node_put(slcr);
goto np_err;
}
--
2.17.1


2018-08-28 01:54:38

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] i2c: 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: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Peter Rosin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/i2c/busses/i2c-powermac.c | 15 ++++++++-------
drivers/i2c/muxes/i2c-mux-gpmux.c | 4 ++--
2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index f2a2067525ef..b706fd136ca5 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -390,7 +390,6 @@ static int i2c_powermac_probe(struct platform_device *dev)
struct pmac_i2c_bus *bus = dev_get_platdata(&dev->dev);
struct device_node *parent = NULL;
struct i2c_adapter *adapter;
- const char *basename;
int rc;

if (bus == NULL)
@@ -407,23 +406,25 @@ static int i2c_powermac_probe(struct platform_device *dev)
parent = of_get_parent(pmac_i2c_get_controller(bus));
if (parent == NULL)
return -EINVAL;
- basename = parent->name;
+ snprintf(adapter->name, sizeof(adapter->name), "%pOFn %d",
+ parent,
+ pmac_i2c_get_channel(bus));
+ of_node_put(parent);
break;
case pmac_i2c_bus_pmu:
- basename = "pmu";
+ snprintf(adapter->name, sizeof(adapter->name), "pmu %d",
+ pmac_i2c_get_channel(bus));
break;
case pmac_i2c_bus_smu:
/* This is not what we used to do but I'm fixing drivers at
* the same time as this change
*/
- basename = "smu";
+ snprintf(adapter->name, sizeof(adapter->name), "smu %d",
+ pmac_i2c_get_channel(bus));
break;
default:
return -EINVAL;
}
- snprintf(adapter->name, sizeof(adapter->name), "%s %d", basename,
- pmac_i2c_get_channel(bus));
- of_node_put(parent);

platform_set_drvdata(dev, adapter);
adapter->algo = &i2c_powermac_algorithm;
diff --git a/drivers/i2c/muxes/i2c-mux-gpmux.c b/drivers/i2c/muxes/i2c-mux-gpmux.c
index 92cf5f48afe6..f60b670deff7 100644
--- a/drivers/i2c/muxes/i2c-mux-gpmux.c
+++ b/drivers/i2c/muxes/i2c-mux-gpmux.c
@@ -120,8 +120,8 @@ static int i2c_mux_probe(struct platform_device *pdev)

ret = of_property_read_u32(child, "reg", &chan);
if (ret < 0) {
- dev_err(dev, "no reg property for node '%s'\n",
- child->name);
+ dev_err(dev, "no reg property for node '%pOFn'\n",
+ child);
goto err_children;
}

--
2.17.1


2018-08-28 01:54:52

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] drm: 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: Gustavo Padovan <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/gpu/drm/drm_modes.c | 4 ++--
drivers/gpu/drm/msm/hdmi/hdmi.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 02db9ac82d7a..24a750436559 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -716,8 +716,8 @@ int of_get_drm_display_mode(struct device_node *np,
if (bus_flags)
drm_bus_flags_from_videomode(&vm, bus_flags);

- pr_debug("%pOF: got %dx%d display mode from %s\n",
- np, vm.hactive, vm.vactive, np->name);
+ pr_debug("%pOF: got %dx%d display mode\n",
+ np, vm.hactive, vm.vactive);
drm_mode_debug_printmodeline(dmode);

return 0;
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index c79659ca5706..23670907a29d 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -579,7 +579,7 @@ static int msm_hdmi_bind(struct device *dev, struct device *master, void *data)
hdmi_cfg = (struct hdmi_platform_config *)
of_device_get_match_data(dev);
if (!hdmi_cfg) {
- dev_err(dev, "unknown hdmi_cfg: %s\n", of_node->name);
+ dev_err(dev, "unknown hdmi_cfg: %pOFn\n", of_node);
return -ENXIO;
}

--
2.17.1


2018-08-28 01:55:07

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] devfreq: 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: Chanwoo Choi <[email protected]>
Cc: MyungJoo Ham <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/devfreq/event/exynos-ppmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
index a9c64f0d3284..c61de0bdf053 100644
--- a/drivers/devfreq/event/exynos-ppmu.c
+++ b/drivers/devfreq/event/exynos-ppmu.c
@@ -535,8 +535,8 @@ static int of_get_devfreq_events(struct device_node *np,

if (i == ARRAY_SIZE(ppmu_events)) {
dev_warn(dev,
- "don't know how to configure events : %s\n",
- node->name);
+ "don't know how to configure events : %pOFn\n",
+ node);
continue;
}

--
2.17.1


2018-08-28 01:55:09

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] gpio: 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: Linus Walleij <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/gpio/gpiolib-of.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index a4f1157d6aa0..089783b11e87 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -348,8 +348,8 @@ static struct gpio_desc *of_parse_own_gpio(struct device_node *np,
else if (of_property_read_bool(np, "output-high"))
*dflags |= GPIOD_OUT_HIGH;
else {
- pr_warn("GPIO line %d (%s): no hogging state specified, bailing out\n",
- desc_to_gpio(desc), np->name);
+ pr_warn("GPIO line %d (%pOFn): no hogging state specified, bailing out\n",
+ desc_to_gpio(desc), np);
return ERR_PTR(-EINVAL);
}

--
2.17.1


2018-08-28 01:55:18

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] dmaengine: 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: Dan Williams <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/dma/nbpfaxi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c
index 8c7b2e8703da..8d4914cd06f0 100644
--- a/drivers/dma/nbpfaxi.c
+++ b/drivers/dma/nbpfaxi.c
@@ -1095,8 +1095,8 @@ static struct dma_chan *nbpf_of_xlate(struct of_phandle_args *dma_spec,
if (!dchan)
return NULL;

- dev_dbg(dchan->device->dev, "Entry %s(%s)\n", __func__,
- dma_spec->np->name);
+ dev_dbg(dchan->device->dev, "Entry %s(%pOFn)\n", __func__,
+ dma_spec->np);

chan = nbpf_to_chan(dchan);

--
2.17.1


2018-08-28 01:55:45

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] cpufreq: 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: "Rafael J. Wysocki" <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/cpufreq/s5pv210-cpufreq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index 5d31c2db12a3..dbecd7667db2 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -611,8 +611,8 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
for_each_compatible_node(np, NULL, "samsung,s5pv210-dmc") {
id = of_alias_get_id(np, "dmc");
if (id < 0 || id >= ARRAY_SIZE(dmc_base)) {
- pr_err("%s: failed to get alias of dmc node '%s'\n",
- __func__, np->name);
+ pr_err("%s: failed to get alias of dmc node '%pOFn'\n",
+ __func__, np);
of_node_put(np);
return id;
}
--
2.17.1


2018-08-28 01:55:48

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] clocksource: 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: Daniel Lezcano <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/clocksource/asm9260_timer.c | 2 +-
drivers/clocksource/cadence_ttc_timer.c | 2 +-
drivers/clocksource/dw_apb_timer_of.c | 8 ++++----
drivers/clocksource/pxa_timer.c | 6 +++---
drivers/clocksource/time-orion.c | 8 ++++----
drivers/clocksource/timer-integrator-ap.c | 2 +-
drivers/clocksource/timer-sp804.c | 2 +-
drivers/clocksource/zevio-timer.c | 8 ++++----
8 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/clocksource/asm9260_timer.c b/drivers/clocksource/asm9260_timer.c
index 38cd2feb87c4..fbaee04fd1d9 100644
--- a/drivers/clocksource/asm9260_timer.c
+++ b/drivers/clocksource/asm9260_timer.c
@@ -193,7 +193,7 @@ static int __init asm9260_timer_init(struct device_node *np)

priv.base = of_io_request_and_map(np, 0, np->name);
if (IS_ERR(priv.base)) {
- pr_err("%s: unable to map resource\n", np->name);
+ pr_err("%pOFn: unable to map resource\n", np);
return PTR_ERR(priv.base);
}

diff --git a/drivers/clocksource/cadence_ttc_timer.c b/drivers/clocksource/cadence_ttc_timer.c
index 29d51755e18b..b33402980b6f 100644
--- a/drivers/clocksource/cadence_ttc_timer.c
+++ b/drivers/clocksource/cadence_ttc_timer.c
@@ -535,7 +535,7 @@ static int __init ttc_timer_init(struct device_node *timer)
if (ret)
return ret;

- pr_info("%s #0 at %p, irq=%d\n", timer->name, timer_baseaddr, irq);
+ pr_info("%pOFn #0 at %p, irq=%d\n", timer, timer_baseaddr, irq);

return 0;
}
diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c
index 69866cd8f4bb..fabaa29cc3a4 100644
--- a/drivers/clocksource/dw_apb_timer_of.c
+++ b/drivers/clocksource/dw_apb_timer_of.c
@@ -33,7 +33,7 @@ static void __init timer_get_base_and_rate(struct device_node *np,
*base = of_iomap(np, 0);

if (!*base)
- panic("Unable to map regs for %s", np->name);
+ panic("Unable to map regs for %pOFn", np);

/*
* Not all implementations use a periphal clock, so don't panic
@@ -42,8 +42,8 @@ static void __init timer_get_base_and_rate(struct device_node *np,
pclk = of_clk_get_by_name(np, "pclk");
if (!IS_ERR(pclk))
if (clk_prepare_enable(pclk))
- pr_warn("pclk for %s is present, but could not be activated\n",
- np->name);
+ pr_warn("pclk for %pOFn is present, but could not be activated\n",
+ np);

timer_clk = of_clk_get_by_name(np, "timer");
if (IS_ERR(timer_clk))
@@ -57,7 +57,7 @@ static void __init timer_get_base_and_rate(struct device_node *np,
try_clock_freq:
if (of_property_read_u32(np, "clock-freq", rate) &&
of_property_read_u32(np, "clock-frequency", rate))
- panic("No clock nor clock-frequency property for %s", np->name);
+ panic("No clock nor clock-frequency property for %pOFn", np);
}

static void __init add_clockevent(struct device_node *event_timer)
diff --git a/drivers/clocksource/pxa_timer.c b/drivers/clocksource/pxa_timer.c
index 08cd6eaf3795..395837938301 100644
--- a/drivers/clocksource/pxa_timer.c
+++ b/drivers/clocksource/pxa_timer.c
@@ -191,13 +191,13 @@ static int __init pxa_timer_dt_init(struct device_node *np)
/* timer registers are shared with watchdog timer */
timer_base = of_iomap(np, 0);
if (!timer_base) {
- pr_err("%s: unable to map resource\n", np->name);
+ pr_err("%pOFn: unable to map resource\n", np);
return -ENXIO;
}

clk = of_clk_get(np, 0);
if (IS_ERR(clk)) {
- pr_crit("%s: unable to get clk\n", np->name);
+ pr_crit("%pOFn: unable to get clk\n", np);
return PTR_ERR(clk);
}

@@ -210,7 +210,7 @@ static int __init pxa_timer_dt_init(struct device_node *np)
/* we are only interested in OS-timer0 irq */
irq = irq_of_parse_and_map(np, 0);
if (irq <= 0) {
- pr_crit("%s: unable to parse OS-timer0 irq\n", np->name);
+ pr_crit("%pOFn: unable to parse OS-timer0 irq\n", np);
return -EINVAL;
}

diff --git a/drivers/clocksource/time-orion.c b/drivers/clocksource/time-orion.c
index 12202067fe4b..7d487107e3cd 100644
--- a/drivers/clocksource/time-orion.c
+++ b/drivers/clocksource/time-orion.c
@@ -129,13 +129,13 @@ static int __init orion_timer_init(struct device_node *np)
/* timer registers are shared with watchdog timer */
timer_base = of_iomap(np, 0);
if (!timer_base) {
- pr_err("%s: unable to map resource\n", np->name);
+ pr_err("%pOFn: unable to map resource\n", np);
return -ENXIO;
}

clk = of_clk_get(np, 0);
if (IS_ERR(clk)) {
- pr_err("%s: unable to get clk\n", np->name);
+ pr_err("%pOFn: unable to get clk\n", np);
return PTR_ERR(clk);
}

@@ -148,7 +148,7 @@ static int __init orion_timer_init(struct device_node *np)
/* we are only interested in timer1 irq */
irq = irq_of_parse_and_map(np, 1);
if (irq <= 0) {
- pr_err("%s: unable to parse timer1 irq\n", np->name);
+ pr_err("%pOFn: unable to parse timer1 irq\n", np);
return -EINVAL;
}

@@ -174,7 +174,7 @@ static int __init orion_timer_init(struct device_node *np)
/* setup timer1 as clockevent timer */
ret = setup_irq(irq, &orion_clkevt_irq);
if (ret) {
- pr_err("%s: unable to setup irq\n", np->name);
+ pr_err("%pOFn: unable to setup irq\n", np);
return ret;
}

diff --git a/drivers/clocksource/timer-integrator-ap.c b/drivers/clocksource/timer-integrator-ap.c
index 62d24690ba02..76e526f58620 100644
--- a/drivers/clocksource/timer-integrator-ap.c
+++ b/drivers/clocksource/timer-integrator-ap.c
@@ -190,7 +190,7 @@ static int __init integrator_ap_timer_init_of(struct device_node *node)

clk = of_clk_get(node, 0);
if (IS_ERR(clk)) {
- pr_err("No clock for %s\n", node->name);
+ pr_err("No clock for %pOFn\n", node);
return PTR_ERR(clk);
}
clk_prepare_enable(clk);
diff --git a/drivers/clocksource/timer-sp804.c b/drivers/clocksource/timer-sp804.c
index e01222ea888f..052b230ca312 100644
--- a/drivers/clocksource/timer-sp804.c
+++ b/drivers/clocksource/timer-sp804.c
@@ -249,7 +249,7 @@ static int __init sp804_of_init(struct device_node *np)
if (of_clk_get_parent_count(np) == 3) {
clk2 = of_clk_get(np, 1);
if (IS_ERR(clk2)) {
- pr_err("sp804: %s clock not found: %d\n", np->name,
+ pr_err("sp804: %pOFn clock not found: %d\n", np,
(int)PTR_ERR(clk2));
clk2 = NULL;
}
diff --git a/drivers/clocksource/zevio-timer.c b/drivers/clocksource/zevio-timer.c
index f74689334f7c..6127e8062a71 100644
--- a/drivers/clocksource/zevio-timer.c
+++ b/drivers/clocksource/zevio-timer.c
@@ -148,12 +148,12 @@ static int __init zevio_timer_add(struct device_node *node)

of_address_to_resource(node, 0, &res);
scnprintf(timer->clocksource_name, sizeof(timer->clocksource_name),
- "%llx.%s_clocksource",
- (unsigned long long)res.start, node->name);
+ "%llx.%pOFn_clocksource",
+ (unsigned long long)res.start, node);

scnprintf(timer->clockevent_name, sizeof(timer->clockevent_name),
- "%llx.%s_clockevent",
- (unsigned long long)res.start, node->name);
+ "%llx.%pOFn_clockevent",
+ (unsigned long long)res.start, node);

if (timer->interrupt_regs && irqnr) {
timer->clkevt.name = timer->clockevent_name;
--
2.17.1


2018-08-28 01:56:00

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] xtensa: 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: Chris Zankel <[email protected]>
Cc: Max Filippov <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/xtensa/platforms/xtfpga/setup.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c
index 42285f35d313..820e8738af11 100644
--- a/arch/xtensa/platforms/xtfpga/setup.c
+++ b/arch/xtensa/platforms/xtfpga/setup.c
@@ -94,7 +94,7 @@ static void __init xtfpga_clk_setup(struct device_node *np)
u32 freq;

if (!base) {
- pr_err("%s: invalid address\n", np->name);
+ pr_err("%pOFn: invalid address\n", np);
return;
}

@@ -103,12 +103,12 @@ static void __init xtfpga_clk_setup(struct device_node *np)
clk = clk_register_fixed_rate(NULL, np->name, NULL, 0, freq);

if (IS_ERR(clk)) {
- pr_err("%s: clk registration failed\n", np->name);
+ pr_err("%pOFn: clk registration failed\n", np);
return;
}

if (of_clk_add_provider(np, of_clk_src_simple_get, clk)) {
- pr_err("%s: clk provider registration failed\n", np->name);
+ pr_err("%pOFn: clk provider registration failed\n", np);
return;
}
}
--
2.17.1


2018-08-28 01:56:03

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] sparc: 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: "David S. Miller" <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/sparc/kernel/auxio_64.c | 4 +--
arch/sparc/kernel/power.c | 4 +--
arch/sparc/kernel/prom_32.c | 26 +++++++-------
arch/sparc/kernel/prom_64.c | 68 ++++++++++++++++++------------------
4 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c
index 4e8f56c3793c..cc42225c20f3 100644
--- a/arch/sparc/kernel/auxio_64.c
+++ b/arch/sparc/kernel/auxio_64.c
@@ -115,8 +115,8 @@ static int auxio_probe(struct platform_device *dev)
auxio_devtype = AUXIO_TYPE_SBUS;
size = 1;
} else {
- printk("auxio: Unknown parent bus type [%s]\n",
- dp->parent->name);
+ printk("auxio: Unknown parent bus type [%pOFn]\n",
+ dp->parent);
return -ENODEV;
}
auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio");
diff --git a/arch/sparc/kernel/power.c b/arch/sparc/kernel/power.c
index 92627abce311..d941875dd718 100644
--- a/arch/sparc/kernel/power.c
+++ b/arch/sparc/kernel/power.c
@@ -41,8 +41,8 @@ static int power_probe(struct platform_device *op)

power_reg = of_ioremap(res, 0, 0x4, "power");

- printk(KERN_INFO "%s: Control reg at %llx\n",
- op->dev.of_node->name, res->start);
+ printk(KERN_INFO "%pOFn: Control reg at %llx\n",
+ op->dev.of_node, res->start);

if (has_button_interrupt(irq, op->dev.of_node)) {
if (request_irq(irq,
diff --git a/arch/sparc/kernel/prom_32.c b/arch/sparc/kernel/prom_32.c
index b51cbb9e87dc..c876a8e62848 100644
--- a/arch/sparc/kernel/prom_32.c
+++ b/arch/sparc/kernel/prom_32.c
@@ -68,8 +68,8 @@ static void __init sparc32_path_component(struct device_node *dp, char *tmp_buf)
return;

regs = rprop->value;
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
regs->which_io, regs->phys_addr);
}

@@ -84,8 +84,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
return;

regs = prop->value;
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
regs->which_io,
regs->phys_addr);
}
@@ -104,13 +104,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value;
devfn = (regs->phys_hi >> 8) & 0xff;
if (devfn & 0x07) {
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
devfn >> 3,
devfn & 0x07);
} else {
- sprintf(tmp_buf, "%s@%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x",
+ dp,
devfn >> 3);
}
}
@@ -127,8 +127,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)

regs = prop->value;

- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
regs->which_io, regs->phys_addr);
}

@@ -167,8 +167,8 @@ static void __init ambapp_path_component(struct device_node *dp, char *tmp_buf)
return;
device = prop->value;

- sprintf(tmp_buf, "%s:%d:%d@%x,%x",
- dp->name, *vendor, *device,
+ sprintf(tmp_buf, "%pOFn:%d:%d@%x,%x",
+ dp, *vendor, *device,
*intr, reg0);
}

@@ -201,7 +201,7 @@ char * __init build_path_component(struct device_node *dp)
tmp_buf[0] = '\0';
__build_path_component(dp, tmp_buf);
if (tmp_buf[0] == '\0')
- strcpy(tmp_buf, dp->name);
+ snprint(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);

n = prom_early_alloc(strlen(tmp_buf) + 1);
strcpy(n, tmp_buf);
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c
index baeaeed64993..6220411ce8fc 100644
--- a/arch/sparc/kernel/prom_64.c
+++ b/arch/sparc/kernel/prom_64.c
@@ -82,8 +82,8 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)

regs = rprop->value;
if (!of_node_is_root(dp->parent)) {
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
(unsigned int) (regs->phys_addr >> 32UL),
(unsigned int) (regs->phys_addr & 0xffffffffUL));
return;
@@ -97,17 +97,17 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
const char *prefix = (type == 0) ? "m" : "i";

if (low_bits)
- sprintf(tmp_buf, "%s@%s%x,%x",
- dp->name, prefix,
+ sprintf(tmp_buf, "%pOFn@%s%x,%x",
+ dp, prefix,
high_bits, low_bits);
else
- sprintf(tmp_buf, "%s@%s%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%s%x",
+ dp,
prefix,
high_bits);
} else if (type == 12) {
- sprintf(tmp_buf, "%s@%x",
- dp->name, high_bits);
+ sprintf(tmp_buf, "%pOFn@%x",
+ dp, high_bits);
}
}

@@ -122,8 +122,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)

regs = prop->value;
if (!of_node_is_root(dp->parent)) {
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
(unsigned int) (regs->phys_addr >> 32UL),
(unsigned int) (regs->phys_addr & 0xffffffffUL));
return;
@@ -138,8 +138,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
if (tlb_type >= cheetah)
mask = 0x7fffff;

- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
*(u32 *)prop->value,
(unsigned int) (regs->phys_addr & mask));
}
@@ -156,8 +156,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
return;

regs = prop->value;
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
regs->which_io,
regs->phys_addr);
}
@@ -176,13 +176,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value;
devfn = (regs->phys_hi >> 8) & 0xff;
if (devfn & 0x07) {
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
devfn >> 3,
devfn & 0x07);
} else {
- sprintf(tmp_buf, "%s@%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x",
+ dp,
devfn >> 3);
}
}
@@ -203,8 +203,8 @@ static void __init upa_path_component(struct device_node *dp, char *tmp_buf)
if (!prop)
return;

- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
*(u32 *) prop->value,
(unsigned int) (regs->phys_addr & 0xffffffffUL));
}
@@ -221,7 +221,7 @@ static void __init vdev_path_component(struct device_node *dp, char *tmp_buf)

regs = prop->value;

- sprintf(tmp_buf, "%s@%x", dp->name, *regs);
+ sprintf(tmp_buf, "%pOFn@%x", dp, *regs);
}

/* "name@addrhi,addrlo" */
@@ -236,8 +236,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)

regs = prop->value;

- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
(unsigned int) (regs->phys_addr >> 32UL),
(unsigned int) (regs->phys_addr & 0xffffffffUL));
}
@@ -257,8 +257,8 @@ static void __init i2c_path_component(struct device_node *dp, char *tmp_buf)
/* This actually isn't right... should look at the #address-cells
* property of the i2c bus node etc. etc.
*/
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name, regs[0], regs[1]);
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp, regs[0], regs[1]);
}

/* "name@reg0[,reg1]" */
@@ -274,11 +274,11 @@ static void __init usb_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value;

if (prop->length == sizeof(u32) || regs[1] == 1) {
- sprintf(tmp_buf, "%s@%x",
- dp->name, regs[0]);
+ sprintf(tmp_buf, "%pOFn@%x",
+ dp, regs[0]);
} else {
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name, regs[0], regs[1]);
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp, regs[0], regs[1]);
}
}

@@ -295,11 +295,11 @@ static void __init ieee1394_path_component(struct device_node *dp, char *tmp_buf
regs = prop->value;

if (regs[2] || regs[3]) {
- sprintf(tmp_buf, "%s@%08x%08x,%04x%08x",
- dp->name, regs[0], regs[1], regs[2], regs[3]);
+ sprintf(tmp_buf, "%pOFn@%08x%08x,%04x%08x",
+ dp, regs[0], regs[1], regs[2], regs[3]);
} else {
- sprintf(tmp_buf, "%s@%08x%08x",
- dp->name, regs[0], regs[1]);
+ sprintf(tmp_buf, "%pOFn@%08x%08x",
+ dp, regs[0], regs[1]);
}
}

@@ -361,7 +361,7 @@ char * __init build_path_component(struct device_node *dp)
tmp_buf[0] = '\0';
__build_path_component(dp, tmp_buf);
if (tmp_buf[0] == '\0')
- strcpy(tmp_buf, dp->name);
+ snprintf(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);

n = prom_early_alloc(strlen(tmp_buf) + 1);
strcpy(n, tmp_buf);
--
2.17.1


2018-08-28 01:56:05

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] bus: fsl-mc: 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: Stuart Yoder <[email protected]>
Cc: Laurentiu Tudor <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
---
drivers/bus/fsl-mc/fsl-mc-bus.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index 5d8266c6571f..85a567c987cc 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -693,8 +693,8 @@ static int parse_mc_ranges(struct device *dev,
*ranges_start = of_get_property(mc_node, "ranges", &ranges_len);
if (!(*ranges_start) || !ranges_len) {
dev_warn(dev,
- "missing or empty ranges property for device tree node '%s'\n",
- mc_node->name);
+ "missing or empty ranges property for device tree node '%pOFn'\n",
+ mc_node);
return 0;
}

@@ -717,7 +717,7 @@ static int parse_mc_ranges(struct device *dev,

tuple_len = range_tuple_cell_count * sizeof(__be32);
if (ranges_len % tuple_len != 0) {
- dev_err(dev, "malformed ranges property '%s'\n", mc_node->name);
+ dev_err(dev, "malformed ranges property '%pOFn'\n", mc_node);
return -EINVAL;
}

--
2.17.1


2018-08-28 01:56:17

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] powerpc: 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: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/powerpc/platforms/44x/fsp2.c | 8 +++---
arch/powerpc/platforms/cell/spu_manage.c | 4 +--
arch/powerpc/platforms/embedded6xx/wii.c | 2 +-
.../powerpc/platforms/powernv/opal-powercap.c | 3 +-
.../platforms/powernv/opal-sensor-groups.c | 4 +--
.../powerpc/platforms/powernv/opal-sysparam.c | 2 +-
arch/powerpc/platforms/pseries/hotplug-cpu.c | 28 +++++++++----------
arch/powerpc/platforms/pseries/ibmebus.c | 2 +-
arch/powerpc/platforms/pseries/vio.c | 27 +++++++++---------
9 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/arch/powerpc/platforms/44x/fsp2.c b/arch/powerpc/platforms/44x/fsp2.c
index 04f0c73a9b4f..7a507f775308 100644
--- a/arch/powerpc/platforms/44x/fsp2.c
+++ b/arch/powerpc/platforms/44x/fsp2.c
@@ -210,15 +210,15 @@ static void node_irq_request(const char *compat, irq_handler_t errirq_handler)
for_each_compatible_node(np, NULL, compat) {
irq = irq_of_parse_and_map(np, 0);
if (irq == NO_IRQ) {
- pr_err("device tree node %s is missing a interrupt",
- np->name);
+ pr_err("device tree node %pOFn is missing a interrupt",
+ np);
return;
}

rc = request_irq(irq, errirq_handler, 0, np->name, np);
if (rc) {
- pr_err("fsp_of_probe: request_irq failed: np=%s rc=%d",
- np->full_name, rc);
+ pr_err("fsp_of_probe: request_irq failed: np=%pOF rc=%d",
+ np, rc);
return;
}
}
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c
index 5c409c98cca8..71ebf7f1bd62 100644
--- a/arch/powerpc/platforms/cell/spu_manage.c
+++ b/arch/powerpc/platforms/cell/spu_manage.c
@@ -295,8 +295,8 @@ static int __init of_enumerate_spus(int (*fn)(void *data))
for_each_node_by_type(node, "spe") {
ret = fn(node);
if (ret) {
- printk(KERN_WARNING "%s: Error initializing %s\n",
- __func__, node->name);
+ printk(KERN_WARNING "%s: Error initializing %pOFn\n",
+ __func__, node);
of_node_put(node);
break;
}
diff --git a/arch/powerpc/platforms/embedded6xx/wii.c b/arch/powerpc/platforms/embedded6xx/wii.c
index 403523c061ba..ecf703ee3a76 100644
--- a/arch/powerpc/platforms/embedded6xx/wii.c
+++ b/arch/powerpc/platforms/embedded6xx/wii.c
@@ -112,7 +112,7 @@ static void __iomem *wii_ioremap_hw_regs(char *name, char *compatible)
}
error = of_address_to_resource(np, 0, &res);
if (error) {
- pr_err("no valid reg found for %s\n", np->name);
+ pr_err("no valid reg found for %pOFn\n", np);
goto out_put;
}

diff --git a/arch/powerpc/platforms/powernv/opal-powercap.c b/arch/powerpc/platforms/powernv/opal-powercap.c
index badb29bde93f..d90ee4fc2c6a 100644
--- a/arch/powerpc/platforms/powernv/opal-powercap.c
+++ b/arch/powerpc/platforms/powernv/opal-powercap.c
@@ -199,7 +199,7 @@ void __init opal_powercap_init(void)
}

j = 0;
- pcaps[i].pg.name = node->name;
+ pcaps[i].pg.name = kasprintf(GFP_KERNEL, "%pOFn", node);
if (has_min) {
powercap_add_attr(min, "powercap-min",
&pcaps[i].pattrs[j]);
@@ -237,6 +237,7 @@ void __init opal_powercap_init(void)
while (--i >= 0) {
kfree(pcaps[i].pattrs);
kfree(pcaps[i].pg.attrs);
+ kfree(pcaps[i].pg.name);
}
kobject_put(powercap_kobj);
out_pcaps:
diff --git a/arch/powerpc/platforms/powernv/opal-sensor-groups.c b/arch/powerpc/platforms/powernv/opal-sensor-groups.c
index f7d04b6a2d7a..179609220e6f 100644
--- a/arch/powerpc/platforms/powernv/opal-sensor-groups.c
+++ b/arch/powerpc/platforms/powernv/opal-sensor-groups.c
@@ -214,9 +214,9 @@ void __init opal_sensor_groups_init(void)
}

if (!of_property_read_u32(node, "ibm,chip-id", &chipid))
- sprintf(sgs[i].name, "%s%d", node->name, chipid);
+ sprintf(sgs[i].name, "%pOFn%d", node, chipid);
else
- sprintf(sgs[i].name, "%s", node->name);
+ sprintf(sgs[i].name, "%pOFn", node);

sgs[i].sg.name = sgs[i].name;
if (add_attr_group(ops, len, &sgs[i], sgid)) {
diff --git a/arch/powerpc/platforms/powernv/opal-sysparam.c b/arch/powerpc/platforms/powernv/opal-sysparam.c
index 9aa87df114fd..916a4b7b1bb5 100644
--- a/arch/powerpc/platforms/powernv/opal-sysparam.c
+++ b/arch/powerpc/platforms/powernv/opal-sysparam.c
@@ -194,7 +194,7 @@ void __init opal_sys_param_init(void)
count = of_property_count_strings(sysparam, "param-name");
if (count < 0) {
pr_err("SYSPARAM: No string found of property param-name in "
- "the node %s\n", sysparam->name);
+ "the node %pOFn\n", sysparam);
goto out_param_buf;
}

diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 6ef77caf7bcf..2f8e62163602 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -287,7 +287,7 @@ static int pseries_add_processor(struct device_node *np)

if (cpumask_empty(tmp)) {
printk(KERN_ERR "Unable to find space in cpu_present_mask for"
- " processor %s with %d thread(s)\n", np->name,
+ " processor %pOFn with %d thread(s)\n", np,
nthreads);
goto out_unlock;
}
@@ -481,8 +481,8 @@ static ssize_t dlpar_cpu_add(u32 drc_index)

if (rc) {
saved_rc = rc;
- pr_warn("Failed to attach node %s, rc: %d, drc index: %x\n",
- dn->name, rc, drc_index);
+ pr_warn("Failed to attach node %pOFn, rc: %d, drc index: %x\n",
+ dn, rc, drc_index);

rc = dlpar_release_drc(drc_index);
if (!rc)
@@ -494,8 +494,8 @@ static ssize_t dlpar_cpu_add(u32 drc_index)
rc = dlpar_online_cpu(dn);
if (rc) {
saved_rc = rc;
- pr_warn("Failed to online cpu %s, rc: %d, drc index: %x\n",
- dn->name, rc, drc_index);
+ pr_warn("Failed to online cpu %pOFn, rc: %d, drc index: %x\n",
+ dn, rc, drc_index);

rc = dlpar_detach_node(dn);
if (!rc)
@@ -504,7 +504,7 @@ static ssize_t dlpar_cpu_add(u32 drc_index)
return saved_rc;
}

- pr_debug("Successfully added CPU %s, drc index: %x\n", dn->name,
+ pr_debug("Successfully added CPU %pOFn, drc index: %x\n", dn,
drc_index);
return rc;
}
@@ -570,19 +570,19 @@ static ssize_t dlpar_cpu_remove(struct device_node *dn, u32 drc_index)
{
int rc;

- pr_debug("Attempting to remove CPU %s, drc index: %x\n",
- dn->name, drc_index);
+ pr_debug("Attempting to remove CPU %pOFn, drc index: %x\n",
+ dn, drc_index);

rc = dlpar_offline_cpu(dn);
if (rc) {
- pr_warn("Failed to offline CPU %s, rc: %d\n", dn->name, rc);
+ pr_warn("Failed to offline CPU %pOFn, rc: %d\n", dn, rc);
return -EINVAL;
}

rc = dlpar_release_drc(drc_index);
if (rc) {
- pr_warn("Failed to release drc (%x) for CPU %s, rc: %d\n",
- drc_index, dn->name, rc);
+ pr_warn("Failed to release drc (%x) for CPU %pOFn, rc: %d\n",
+ drc_index, dn, rc);
dlpar_online_cpu(dn);
return rc;
}
@@ -591,7 +591,7 @@ static ssize_t dlpar_cpu_remove(struct device_node *dn, u32 drc_index)
if (rc) {
int saved_rc = rc;

- pr_warn("Failed to detach CPU %s, rc: %d", dn->name, rc);
+ pr_warn("Failed to detach CPU %pOFn, rc: %d", dn, rc);

rc = dlpar_acquire_drc(drc_index);
if (!rc)
@@ -662,8 +662,8 @@ static int find_dlpar_cpus_to_remove(u32 *cpu_drcs, int cpus_to_remove)
rc = of_property_read_u32(dn, "ibm,my-drc-index",
&cpu_drcs[cpus_found - 1]);
if (rc) {
- pr_warn("Error occurred getting drc-index for %s\n",
- dn->name);
+ pr_warn("Error occurred getting drc-index for %pOFn\n",
+ dn);
of_node_put(dn);
return -1;
}
diff --git a/arch/powerpc/platforms/pseries/ibmebus.c b/arch/powerpc/platforms/pseries/ibmebus.c
index c7c1140c13b6..5b4a56131904 100644
--- a/arch/powerpc/platforms/pseries/ibmebus.c
+++ b/arch/powerpc/platforms/pseries/ibmebus.c
@@ -404,7 +404,7 @@ static ssize_t name_show(struct device *dev,
struct platform_device *ofdev;

ofdev = to_platform_device(dev);
- return sprintf(buf, "%s\n", ofdev->dev.of_node->name);
+ return sprintf(buf, "%pOFn\n", ofdev->dev.of_node);
}
static DEVICE_ATTR_RO(name);

diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index 49e04ec19238..88f1ad1d6309 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -1349,7 +1349,6 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
struct device_node *parent_node;
const __be32 *prop;
enum vio_dev_family family;
- const char *of_node_name = of_node->name ? of_node->name : "<unknown>";

/*
* Determine if this node is a under the /vdevice node or under the
@@ -1362,24 +1361,24 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
else if (!strcmp(parent_node->type, "vdevice"))
family = VDEVICE;
else {
- pr_warn("%s: parent(%pOF) of %s not recognized.\n",
+ pr_warn("%s: parent(%pOF) of %pOFn not recognized.\n",
__func__,
parent_node,
- of_node_name);
+ of_node);
of_node_put(parent_node);
return NULL;
}
of_node_put(parent_node);
} else {
- pr_warn("%s: could not determine the parent of node %s.\n",
- __func__, of_node_name);
+ pr_warn("%s: could not determine the parent of node %pOFn.\n",
+ __func__, of_node);
return NULL;
}

if (family == PFO) {
if (of_get_property(of_node, "interrupt-controller", NULL)) {
- pr_debug("%s: Skipping the interrupt controller %s.\n",
- __func__, of_node_name);
+ pr_debug("%s: Skipping the interrupt controller %pOFn.\n",
+ __func__, of_node);
return NULL;
}
}
@@ -1399,15 +1398,15 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
if (of_node->type != NULL)
viodev->type = of_node->type;
else {
- pr_warn("%s: node %s is missing the 'device_type' "
- "property.\n", __func__, of_node_name);
+ pr_warn("%s: node %pOFn is missing the 'device_type' "
+ "property.\n", __func__, of_node);
goto out;
}

prop = of_get_property(of_node, "reg", NULL);
if (prop == NULL) {
- pr_warn("%s: node %s missing 'reg'\n",
- __func__, of_node_name);
+ pr_warn("%s: node %pOFn missing 'reg'\n",
+ __func__, of_node);
goto out;
}
unit_address = of_read_number(prop, 1);
@@ -1422,8 +1421,8 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
if (prop != NULL)
viodev->resource_id = of_read_number(prop, 1);

- dev_set_name(&viodev->dev, "%s", of_node_name);
- viodev->type = of_node_name;
+ dev_set_name(&viodev->dev, "%pOFn", of_node);
+ viodev->type = dev_name(&viodev->dev);
viodev->irq = 0;
}

@@ -1694,7 +1693,7 @@ struct vio_dev *vio_find_node(struct device_node *vnode)
snprintf(kobj_name, sizeof(kobj_name), "%x",
(uint32_t)of_read_number(prop, 1));
} else if (!strcmp(dev_type, "ibm,platform-facilities"))
- snprintf(kobj_name, sizeof(kobj_name), "%s", vnode->name);
+ snprintf(kobj_name, sizeof(kobj_name), "%pOFn", vnode);
else
return NULL;

--
2.17.1


2018-08-28 01:56:21

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] nios2: 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: Ley Foon Tan <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/nios2/kernel/time.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/nios2/kernel/time.c b/arch/nios2/kernel/time.c
index ab88b6dd4679..54467d0085a1 100644
--- a/arch/nios2/kernel/time.c
+++ b/arch/nios2/kernel/time.c
@@ -214,12 +214,12 @@ static int __init nios2_timer_get_base_and_freq(struct device_node *np,
{
*base = of_iomap(np, 0);
if (!*base) {
- pr_crit("Unable to map reg for %s\n", np->name);
+ pr_crit("Unable to map reg for %pOFn\n", np);
return -ENXIO;
}

if (of_property_read_u32(np, "clock-frequency", freq)) {
- pr_crit("Unable to get %s clock frequency\n", np->name);
+ pr_crit("Unable to get %pOFn clock frequency\n", np);
return -EINVAL;
}

--
2.17.1


2018-08-28 01:56:30

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] ARM: zynq: 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: Michal Simek <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/arm/mach-zynq/slcr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index f0292a30e6f6..10ef99ce1d90 100644
--- a/arch/arm/mach-zynq/slcr.c
+++ b/arch/arm/mach-zynq/slcr.c
@@ -233,7 +233,7 @@ int __init zynq_early_slcr_init(void)

register_restart_handler(&zynq_slcr_restart_nb);

- pr_info("%s mapped to %p\n", np->name, zynq_slcr_base);
+ pr_info("%pOFn mapped to %p\n", np, zynq_slcr_base);

of_node_put(np);

--
2.17.1


2018-08-28 01:56:33

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] ata: ahci: 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: Hans de Goede <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/ata/libahci_platform.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index c92c10d55374..8ac2be869dd9 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -303,8 +303,8 @@ static int ahci_platform_get_phy(struct ahci_host_priv *hpriv, u32 port,
/* No PHY support. Check if PHY is required. */
if (of_find_property(node, "phys", NULL)) {
dev_err(dev,
- "couldn't get PHY in node %s: ENOSYS\n",
- node->name);
+ "couldn't get PHY in node %pOFn: ENOSYS\n",
+ node);
break;
}
/* fall through */
@@ -316,8 +316,8 @@ static int ahci_platform_get_phy(struct ahci_host_priv *hpriv, u32 port,

default:
dev_err(dev,
- "couldn't get PHY in node %s: %d\n",
- node->name, rc);
+ "couldn't get PHY in node %pOFn: %d\n",
+ node, rc);

break;
}
--
2.17.1


2018-08-28 01:56:46

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] macintosh: 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: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/macintosh/macio_sysfs.c | 8 +++++++-
drivers/macintosh/windfarm_smu_controls.c | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c
index ca4fcffe454b..d2451e58acb9 100644
--- a/drivers/macintosh/macio_sysfs.c
+++ b/drivers/macintosh/macio_sysfs.c
@@ -58,7 +58,13 @@ static ssize_t devspec_show(struct device *dev,
static DEVICE_ATTR_RO(modalias);
static DEVICE_ATTR_RO(devspec);

-macio_config_of_attr (name, "%s\n");
+static ssize_t name_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ return sprintf(buf, "%pOFn\n", dev->of_node);
+}
+static DEVICE_ATTR_RO(name);
+
macio_config_of_attr (type, "%s\n");

static struct attribute *macio_dev_attrs[] = {
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c
index d174c7437337..86d65462a61c 100644
--- a/drivers/macintosh/windfarm_smu_controls.c
+++ b/drivers/macintosh/windfarm_smu_controls.c
@@ -277,7 +277,7 @@ static int __init smu_controls_init(void)
fct = smu_fan_create(fan, 0);
if (fct == NULL) {
printk(KERN_WARNING "windfarm: Failed to create SMU "
- "RPM fan %s\n", fan->name);
+ "RPM fan %pOFn\n", fan);
continue;
}
list_add(&fct->link, &smu_fans);
@@ -296,7 +296,7 @@ static int __init smu_controls_init(void)
fct = smu_fan_create(fan, 1);
if (fct == NULL) {
printk(KERN_WARNING "windfarm: Failed to create SMU "
- "PWM fan %s\n", fan->name);
+ "PWM fan %pOFn\n", fan);
continue;
}
list_add(&fct->link, &smu_fans);
--
2.17.1


2018-08-28 01:56:47

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] mailbox: 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: Jassi Brar <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
---
drivers/mailbox/ti-msgmgr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mailbox/ti-msgmgr.c b/drivers/mailbox/ti-msgmgr.c
index 5bceafbf6699..713d701b6568 100644
--- a/drivers/mailbox/ti-msgmgr.c
+++ b/drivers/mailbox/ti-msgmgr.c
@@ -560,8 +560,8 @@ static struct mbox_chan *ti_msgmgr_of_xlate(struct mbox_controller *mbox,
}

err:
- dev_err(inst->dev, "Queue ID %d, Proxy ID %d is wrong on %s\n",
- req_qid, req_pid, p->np->name);
+ dev_err(inst->dev, "Queue ID %d, Proxy ID %d is wrong on %pOFn\n",
+ req_qid, req_pid, p->np);
return ERR_PTR(-ENOENT);
}

--
2.17.1


2018-08-28 01:56:54

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] phy: 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: Kishon Vijay Abraham I <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/phy/broadcom/phy-bcm-cygnus-pcie.c | 4 ++--
drivers/phy/broadcom/phy-brcm-sata.c | 4 ++--
drivers/phy/marvell/phy-berlin-sata.c | 6 +++---
drivers/phy/qualcomm/phy-qcom-qmp.c | 2 +-
drivers/phy/rockchip/phy-rockchip-emmc.c | 4 ++--
drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 8 ++++----
drivers/phy/rockchip/phy-rockchip-typec.c | 8 ++++----
drivers/phy/rockchip/phy-rockchip-usb.c | 4 ++--
drivers/phy/tegra/xusb.c | 4 ++--
9 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/phy/broadcom/phy-bcm-cygnus-pcie.c b/drivers/phy/broadcom/phy-bcm-cygnus-pcie.c
index 0f4ac5d63cff..b074682d9dd8 100644
--- a/drivers/phy/broadcom/phy-bcm-cygnus-pcie.c
+++ b/drivers/phy/broadcom/phy-bcm-cygnus-pcie.c
@@ -153,8 +153,8 @@ static int cygnus_pcie_phy_probe(struct platform_device *pdev)
struct cygnus_pcie_phy *p;

if (of_property_read_u32(child, "reg", &id)) {
- dev_err(dev, "missing reg property for %s\n",
- child->name);
+ dev_err(dev, "missing reg property for %pOFn\n",
+ child);
ret = -EINVAL;
goto put_child;
}
diff --git a/drivers/phy/broadcom/phy-brcm-sata.c b/drivers/phy/broadcom/phy-brcm-sata.c
index 8708ea3b4d6d..ac57f5a41708 100644
--- a/drivers/phy/broadcom/phy-brcm-sata.c
+++ b/drivers/phy/broadcom/phy-brcm-sata.c
@@ -600,8 +600,8 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)
struct brcm_sata_port *port;

if (of_property_read_u32(child, "reg", &id)) {
- dev_err(dev, "missing reg property in node %s\n",
- child->name);
+ dev_err(dev, "missing reg property in node %pOFn\n",
+ child);
ret = -EINVAL;
goto put_child;
}
diff --git a/drivers/phy/marvell/phy-berlin-sata.c b/drivers/phy/marvell/phy-berlin-sata.c
index c1bb6725e48f..a91fc67fc4e0 100644
--- a/drivers/phy/marvell/phy-berlin-sata.c
+++ b/drivers/phy/marvell/phy-berlin-sata.c
@@ -231,14 +231,14 @@ static int phy_berlin_sata_probe(struct platform_device *pdev)
struct phy_berlin_desc *phy_desc;

if (of_property_read_u32(child, "reg", &phy_id)) {
- dev_err(dev, "missing reg property in node %s\n",
- child->name);
+ dev_err(dev, "missing reg property in node %pOFn\n",
+ child);
ret = -EINVAL;
goto put_child;
}

if (phy_id >= ARRAY_SIZE(phy_berlin_power_down_bits)) {
- dev_err(dev, "invalid reg in node %s\n", child->name);
+ dev_err(dev, "invalid reg in node %pOFn\n", child);
ret = -EINVAL;
goto put_child;
}
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c
index 4c470104a0d6..baa59484a90c 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
@@ -1400,7 +1400,7 @@ static int phy_pipe_clk_register(struct qcom_qmp *qmp, struct device_node *np)

ret = of_property_read_string(np, "clock-output-names", &init.name);
if (ret) {
- dev_err(qmp->dev, "%s: No clock-output-names\n", np->name);
+ dev_err(qmp->dev, "%pOFn: No clock-output-names\n", np);
return ret;
}

diff --git a/drivers/phy/rockchip/phy-rockchip-emmc.c b/drivers/phy/rockchip/phy-rockchip-emmc.c
index b237360f95f6..19bf84f0bc67 100644
--- a/drivers/phy/rockchip/phy-rockchip-emmc.c
+++ b/drivers/phy/rockchip/phy-rockchip-emmc.c
@@ -337,8 +337,8 @@ static int rockchip_emmc_phy_probe(struct platform_device *pdev)
return -ENOMEM;

if (of_property_read_u32(dev->of_node, "reg", &reg_offset)) {
- dev_err(dev, "missing reg property in node %s\n",
- dev->of_node->name);
+ dev_err(dev, "missing reg property in node %pOFn\n",
+ dev->of_node);
return -EINVAL;
}

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index 5049dac79bd0..24bd2717abdb 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -1116,8 +1116,8 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev)
}

if (of_property_read_u32(np, "reg", &reg)) {
- dev_err(dev, "the reg property is not assigned in %s node\n",
- np->name);
+ dev_err(dev, "the reg property is not assigned in %pOFn node\n",
+ np);
return -EINVAL;
}

@@ -1143,8 +1143,8 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev)
}

if (!rphy->phy_cfg) {
- dev_err(dev, "no phy-config can be matched with %s node\n",
- np->name);
+ dev_err(dev, "no phy-config can be matched with %pOFn node\n",
+ np);
return -EINVAL;
}

diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
index 76a4b58ec771..c57e496f0b0c 100644
--- a/drivers/phy/rockchip/phy-rockchip-typec.c
+++ b/drivers/phy/rockchip/phy-rockchip-typec.c
@@ -1145,8 +1145,8 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
}

if (!tcphy->port_cfgs) {
- dev_err(dev, "no phy-config can be matched with %s node\n",
- np->name);
+ dev_err(dev, "no phy-config can be matched with %pOFn node\n",
+ np);
return -EINVAL;
}

@@ -1186,8 +1186,8 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
continue;

if (IS_ERR(phy)) {
- dev_err(dev, "failed to create phy: %s\n",
- child_np->name);
+ dev_err(dev, "failed to create phy: %pOFn\n",
+ child_np);
pm_runtime_disable(dev);
return PTR_ERR(phy);
}
diff --git a/drivers/phy/rockchip/phy-rockchip-usb.c b/drivers/phy/rockchip/phy-rockchip-usb.c
index 3378eeb7a562..269c86329cb8 100644
--- a/drivers/phy/rockchip/phy-rockchip-usb.c
+++ b/drivers/phy/rockchip/phy-rockchip-usb.c
@@ -208,8 +208,8 @@ static int rockchip_usb_phy_init(struct rockchip_usb_phy_base *base,
rk_phy->np = child;

if (of_property_read_u32(child, "reg", &reg_offset)) {
- dev_err(base->dev, "missing reg property in node %s\n",
- child->name);
+ dev_err(base->dev, "missing reg property in node %pOFn\n",
+ child);
return -EINVAL;
}

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index de1b4ebe4de2..5b3b8863363e 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -115,8 +115,8 @@ int tegra_xusb_lane_parse_dt(struct tegra_xusb_lane *lane,

err = match_string(lane->soc->funcs, lane->soc->num_funcs, function);
if (err < 0) {
- dev_err(dev, "invalid function \"%s\" for lane \"%s\"\n",
- function, np->name);
+ dev_err(dev, "invalid function \"%s\" for lane \"%pOFn\"\n",
+ function, np);
return err;
}

--
2.17.1


2018-08-28 01:57:09

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] input: sun4i-lradc: 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: Hans de Goede <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/input/keyboard/sun4i-lradc-keys.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/sun4i-lradc-keys.c b/drivers/input/keyboard/sun4i-lradc-keys.c
index a37c172452e6..57272df34cd5 100644
--- a/drivers/input/keyboard/sun4i-lradc-keys.c
+++ b/drivers/input/keyboard/sun4i-lradc-keys.c
@@ -185,19 +185,19 @@ static int sun4i_lradc_load_dt_keymap(struct device *dev,

error = of_property_read_u32(pp, "channel", &channel);
if (error || channel != 0) {
- dev_err(dev, "%s: Inval channel prop\n", pp->name);
+ dev_err(dev, "%pOFn: Inval channel prop\n", pp);
return -EINVAL;
}

error = of_property_read_u32(pp, "voltage", &map->voltage);
if (error) {
- dev_err(dev, "%s: Inval voltage prop\n", pp->name);
+ dev_err(dev, "%pOFn: Inval voltage prop\n", pp);
return -EINVAL;
}

error = of_property_read_u32(pp, "linux,code", &map->keycode);
if (error) {
- dev_err(dev, "%s: Inval linux,code prop\n", pp->name);
+ dev_err(dev, "%pOFn: Inval linux,code prop\n", pp);
return -EINVAL;
}

--
2.17.1


2018-08-28 01:57:19

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] sound: 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: Johannes Berg <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
sound/aoa/soundbus/i2sbus/core.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c
index 000b58522106..bf32e1c74748 100644
--- a/sound/aoa/soundbus/i2sbus/core.c
+++ b/sound/aoa/soundbus/i2sbus/core.c
@@ -157,18 +157,19 @@ static int i2sbus_add_dev(struct macio_dev *macio,
struct device_node *child = NULL, *sound = NULL;
struct resource *r;
int i, layout = 0, rlen, ok = force;
- static const char *rnames[] = { "i2sbus: %s (control)",
- "i2sbus: %s (tx)",
- "i2sbus: %s (rx)" };
+ char node_name[6];
+ static const char *rnames[] = { "i2sbus: %pOFn (control)",
+ "i2sbus: %pOFn (tx)",
+ "i2sbus: %pOFn (rx)" };
static irq_handler_t ints[] = {
i2sbus_bus_intr,
i2sbus_tx_intr,
i2sbus_rx_intr
};

- if (strlen(np->name) != 5)
+ if (snprintf(node_name, sizeof(node_name), "%pOFn", np) != 5)
return 0;
- if (strncmp(np->name, "i2s-", 4))
+ if (strncmp(np, "i2s-", 4))
return 0;

dev = kzalloc(sizeof(struct i2sbus_dev), GFP_KERNEL);
@@ -228,13 +229,13 @@ static int i2sbus_add_dev(struct macio_dev *macio,
dev->sound.pcmid = -1;
dev->macio = macio;
dev->control = control;
- dev->bus_number = np->name[4] - 'a';
+ dev->bus_number = node_name[4] - 'a';
INIT_LIST_HEAD(&dev->sound.codec_list);

for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
dev->interrupts[i] = -1;
snprintf(dev->rnames[i], sizeof(dev->rnames[i]),
- rnames[i], np->name);
+ rnames[i], np);
}
for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
int irq = irq_of_parse_and_map(np, i);
--
2.17.1


2018-08-28 01:57:23

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] fbdev: 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: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/video/fbdev/cg14.c | 4 +---
drivers/video/fbdev/cg3.c | 2 +-
drivers/video/fbdev/core/fbmon.c | 4 ++--
drivers/video/fbdev/imsttfb.c | 2 +-
drivers/video/fbdev/leo.c | 2 +-
drivers/video/fbdev/offb.c | 12 ++++++++----
drivers/video/fbdev/p9100.c | 2 +-
drivers/video/of_display_timing.c | 2 +-
8 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/video/fbdev/cg14.c b/drivers/video/fbdev/cg14.c
index 8de88b129b62..9af54c2368fd 100644
--- a/drivers/video/fbdev/cg14.c
+++ b/drivers/video/fbdev/cg14.c
@@ -355,9 +355,7 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
static void cg14_init_fix(struct fb_info *info, int linebytes,
struct device_node *dp)
{
- const char *name = dp->name;
-
- strlcpy(info->fix.id, name, sizeof(info->fix.id));
+ snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);

info->fix.type = FB_TYPE_PACKED_PIXELS;
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
diff --git a/drivers/video/fbdev/cg3.c b/drivers/video/fbdev/cg3.c
index 6c334260cf53..1bd95b02f3aa 100644
--- a/drivers/video/fbdev/cg3.c
+++ b/drivers/video/fbdev/cg3.c
@@ -246,7 +246,7 @@ static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
static void cg3_init_fix(struct fb_info *info, int linebytes,
struct device_node *dp)
{
- strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
+ snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);

info->fix.type = FB_TYPE_PACKED_PIXELS;
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 852d86c1c527..dd3128990776 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -1480,8 +1480,8 @@ int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb,
if (ret)
return ret;

- pr_debug("%pOF: got %dx%d display mode from %s\n",
- np, vm.hactive, vm.vactive, np->name);
+ pr_debug("%pOF: got %dx%d display mode\n",
+ np, vm.hactive, vm.vactive);
dump_fb_videomode(fb);

return 0;
diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c
index ecdcf358ad5e..901ca4ed10e9 100644
--- a/drivers/video/fbdev/imsttfb.c
+++ b/drivers/video/fbdev/imsttfb.c
@@ -1473,7 +1473,7 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

dp = pci_device_to_OF_node(pdev);
if(dp)
- printk(KERN_INFO "%s: OF name %s\n",__func__, dp->name);
+ printk(KERN_INFO "%s: OF name %pOFn\n",__func__, dp);
else if (IS_ENABLED(CONFIG_OF))
printk(KERN_ERR "imsttfb: no OF node for pci device\n");

diff --git a/drivers/video/fbdev/leo.c b/drivers/video/fbdev/leo.c
index 71862188f528..446ac3364bad 100644
--- a/drivers/video/fbdev/leo.c
+++ b/drivers/video/fbdev/leo.c
@@ -434,7 +434,7 @@ static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
static void
leo_init_fix(struct fb_info *info, struct device_node *dp)
{
- strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
+ snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);

info->fix.type = FB_TYPE_PACKED_PIXELS;
info->fix.visual = FB_VISUAL_TRUECOLOR;
diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
index 77c0a2f45b3b..31f769d67195 100644
--- a/drivers/video/fbdev/offb.c
+++ b/drivers/video/fbdev/offb.c
@@ -419,9 +419,13 @@ static void __init offb_init_fb(const char *name,
var = &info->var;
info->par = par;

- strcpy(fix->id, "OFfb ");
- strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb "));
- fix->id[sizeof(fix->id) - 1] = '\0';
+ if (name) {
+ strcpy(fix->id, "OFfb ");
+ strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb "));
+ fix->id[sizeof(fix->id) - 1] = '\0';
+ } else
+ snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp);
+

var->xres = var->xres_virtual = width;
var->yres = var->yres_virtual = height;
@@ -644,7 +648,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
/* kludge for valkyrie */
if (strcmp(dp->name, "valkyrie") == 0)
address += 0x1000;
- offb_init_fb(no_real_node ? "bootx" : dp->name,
+ offb_init_fb(no_real_node ? "bootx" : NULL,
width, height, depth, pitch, address,
foreign_endian, no_real_node ? NULL : dp);
}
diff --git a/drivers/video/fbdev/p9100.c b/drivers/video/fbdev/p9100.c
index 64de5cda541d..c4283e9e95af 100644
--- a/drivers/video/fbdev/p9100.c
+++ b/drivers/video/fbdev/p9100.c
@@ -239,7 +239,7 @@ static int p9100_ioctl(struct fb_info *info, unsigned int cmd,

static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_node *dp)
{
- strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
+ snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);

info->fix.type = FB_TYPE_PACKED_PIXELS;
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index 5244e93ceafc..c2e7aa103fa5 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -170,7 +170,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
goto entryfail;
}

- pr_debug("%pOF: using %s as default timing\n", np, entry->name);
+ pr_debug("%pOF: using %pOFn as default timing\n", np, entry);

native_mode = entry;

--
2.17.1


2018-08-28 01:57:27

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] ASoC: 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: Timur Tabi <[email protected]>
Cc: Nicolin Chen <[email protected]>
Cc: Xiubo Li <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Carlo Caione <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Olivier Moysan <[email protected]>
Cc: Arnaud Pouliquen <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
sound/soc/fsl/fsl_esai.c | 2 +-
sound/soc/fsl/fsl_utils.c | 4 ++--
sound/soc/meson/axg-card.c | 2 +-
sound/soc/stm/stm32_sai.c | 2 +-
sound/soc/stm/stm32_sai_sub.c | 8 ++++----
5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index c1d1d06783e5..57b484768a58 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -807,7 +807,7 @@ static int fsl_esai_probe(struct platform_device *pdev)
return -ENOMEM;

esai_priv->pdev = pdev;
- strncpy(esai_priv->name, np->name, sizeof(esai_priv->name) - 1);
+ snprintf(esai_priv->name, sizeof(esai_priv->name), "%pOFn", np);

/* Get the addresses and IRQ */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
diff --git a/sound/soc/fsl/fsl_utils.c b/sound/soc/fsl/fsl_utils.c
index 7f0fa4b52223..9981668ab590 100644
--- a/sound/soc/fsl/fsl_utils.c
+++ b/sound/soc/fsl/fsl_utils.c
@@ -57,8 +57,8 @@ int fsl_asoc_get_dma_channel(struct device_node *ssi_np,
of_node_put(dma_channel_np);
return ret;
}
- snprintf((char *)dai->platform_name, DAI_NAME_SIZE, "%llx.%s",
- (unsigned long long) res.start, dma_channel_np->name);
+ snprintf((char *)dai->platform_name, DAI_NAME_SIZE, "%llx.%pOFn",
+ (unsigned long long) res.start, dma_channel_np);

iprop = of_get_property(dma_channel_np, "cell-index", NULL);
if (!iprop) {
diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c
index 2914ba0d965b..b76a5f4f1785 100644
--- a/sound/soc/meson/axg-card.c
+++ b/sound/soc/meson/axg-card.c
@@ -478,7 +478,7 @@ static int axg_card_set_be_link(struct snd_soc_card *card,

ret = axg_card_set_link_name(card, link, "be");
if (ret)
- dev_err(card->dev, "error setting %s link name\n", np->name);
+ dev_err(card->dev, "error setting %pOFn link name\n", np);

return ret;
}
diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c
index f22654253c43..d597eba61992 100644
--- a/sound/soc/stm/stm32_sai.c
+++ b/sound/soc/stm/stm32_sai.c
@@ -104,7 +104,7 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client,

if (!pdev) {
dev_err(&sai_client->pdev->dev,
- "Device not found for node %s\n", np_provider->name);
+ "Device not found for node %pOFn\n", np_provider);
return -ENODEV;
}

diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index 06fba9650ac4..cad8c7888292 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -1124,16 +1124,16 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev,
sai->sync = SAI_SYNC_NONE;
if (args.np) {
if (args.np == np) {
- dev_err(&pdev->dev, "%s sync own reference\n",
- np->name);
+ dev_err(&pdev->dev, "%pOFn sync own reference\n",
+ np);
of_node_put(args.np);
return -EINVAL;
}

sai->np_sync_provider = of_get_parent(args.np);
if (!sai->np_sync_provider) {
- dev_err(&pdev->dev, "%s parent node not found\n",
- np->name);
+ dev_err(&pdev->dev, "%pOFn parent node not found\n",
+ np);
of_node_put(args.np);
return -ENODEV;
}
--
2.17.1


2018-08-28 01:57:33

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] backlight: pm8941: 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: Lee Jones <[email protected]>
Cc: Daniel Thompson <[email protected]>
Cc: Jingoo Han <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/video/backlight/pm8941-wled.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/pm8941-wled.c b/drivers/video/backlight/pm8941-wled.c
index 0b6d21955d91..da6aab20fdcb 100644
--- a/drivers/video/backlight/pm8941-wled.c
+++ b/drivers/video/backlight/pm8941-wled.c
@@ -330,7 +330,7 @@ static int pm8941_wled_configure(struct pm8941_wled *wled, struct device *dev)

rc = of_property_read_string(dev->of_node, "label", &wled->name);
if (rc)
- wled->name = dev->of_node->name;
+ wled->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFn", dev->of_node);

*cfg = pm8941_wled_config_defaults;
for (i = 0; i < ARRAY_SIZE(u32_opts); ++i) {
--
2.17.1


2018-08-28 01:57:40

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] tty: 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: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/tty/ehv_bytechan.c | 12 ++++++------
drivers/tty/serial/cpm_uart/cpm_uart_core.c | 8 ++++----
drivers/tty/serial/pmac_zilog.c | 4 ++--
3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c
index eea4049b5dcc..769e0a5d1dfc 100644
--- a/drivers/tty/ehv_bytechan.c
+++ b/drivers/tty/ehv_bytechan.c
@@ -128,8 +128,8 @@ static int find_console_handle(void)
*/
iprop = of_get_property(np, "hv-handle", NULL);
if (!iprop) {
- pr_err("ehv-bc: no 'hv-handle' property in %s node\n",
- np->name);
+ pr_err("ehv-bc: no 'hv-handle' property in %pOFn node\n",
+ np);
return 0;
}
stdout_bc = be32_to_cpu(*iprop);
@@ -661,8 +661,8 @@ static int ehv_bc_tty_probe(struct platform_device *pdev)

iprop = of_get_property(np, "hv-handle", NULL);
if (!iprop) {
- dev_err(&pdev->dev, "no 'hv-handle' property in %s node\n",
- np->name);
+ dev_err(&pdev->dev, "no 'hv-handle' property in %pOFn node\n",
+ np);
return -ENODEV;
}

@@ -682,8 +682,8 @@ static int ehv_bc_tty_probe(struct platform_device *pdev)
bc->rx_irq = irq_of_parse_and_map(np, 0);
bc->tx_irq = irq_of_parse_and_map(np, 1);
if ((bc->rx_irq == NO_IRQ) || (bc->tx_irq == NO_IRQ)) {
- dev_err(&pdev->dev, "no 'interrupts' property in %s node\n",
- np->name);
+ dev_err(&pdev->dev, "no 'interrupts' property in %pOFn node\n",
+ np);
ret = -ENODEV;
goto error;
}
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
index 24a5f05e769b..ea7204d75022 100644
--- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
@@ -1151,8 +1151,8 @@ static int cpm_uart_init_port(struct device_node *np,
if (!pinfo->clk) {
data = of_get_property(np, "fsl,cpm-brg", &len);
if (!data || len != 4) {
- printk(KERN_ERR "CPM UART %s has no/invalid "
- "fsl,cpm-brg property.\n", np->name);
+ printk(KERN_ERR "CPM UART %pOFn has no/invalid "
+ "fsl,cpm-brg property.\n", np);
return -EINVAL;
}
pinfo->brg = *data;
@@ -1160,8 +1160,8 @@ static int cpm_uart_init_port(struct device_node *np,

data = of_get_property(np, "fsl,cpm-command", &len);
if (!data || len != 4) {
- printk(KERN_ERR "CPM UART %s has no/invalid "
- "fsl,cpm-command property.\n", np->name);
+ printk(KERN_ERR "CPM UART %pOFn has no/invalid "
+ "fsl,cpm-command property.\n", np);
return -EINVAL;
}
pinfo->command = *data;
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
index 3d21790d961e..a4ec22d1f214 100644
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -1566,9 +1566,9 @@ static int pmz_attach(struct macio_dev *mdev, const struct of_device_id *match)
* to work around bugs in ancient Apple device-trees
*/
if (macio_request_resources(uap->dev, "pmac_zilog"))
- printk(KERN_WARNING "%s: Failed to request resource"
+ printk(KERN_WARNING "%pOFn: Failed to request resource"
", port still active\n",
- uap->node->name);
+ uap->node);
else
uap->flags |= PMACZILOG_FLAG_RSRC_REQUESTED;

--
2.17.1


2018-08-28 01:57:46

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] ARM: shmobile: 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: Simon Horman <[email protected]>
Cc: Magnus Damm <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/arm/mach-shmobile/pm-rmobile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
index e348bcfe389d..9dd6cadcd900 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -189,7 +189,7 @@ static void __init add_special_pd(struct device_node *np, enum pd_types type)
return;
}

- pr_debug("Special PM domain %s type %d for %pOF\n", pd->name, type, np);
+ pr_debug("Special PM domain %pOFn type %d for %pOF\n", pd, type, np);

special_pds[num_special_pds].pd = pd;
special_pds[num_special_pds].type = type;
--
2.17.1


2018-08-28 01:57:46

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] uio: 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: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
---
drivers/uio/uio_fsl_elbc_gpcm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/uio/uio_fsl_elbc_gpcm.c b/drivers/uio/uio_fsl_elbc_gpcm.c
index bbc17effae5e..9cc37fe07d35 100644
--- a/drivers/uio/uio_fsl_elbc_gpcm.c
+++ b/drivers/uio/uio_fsl_elbc_gpcm.c
@@ -382,8 +382,7 @@ static int uio_fsl_elbc_gpcm_probe(struct platform_device *pdev)
}

/* set all UIO data */
- if (node->name)
- info->mem[0].name = kstrdup(node->name, GFP_KERNEL);
+ info->mem[0].name = kasprintf(GFP_KERNEL, "%pOFn", node);
info->mem[0].addr = res.start;
info->mem[0].size = resource_size(&res);
info->mem[0].memtype = UIO_MEM_PHYS;
--
2.17.1


2018-08-28 01:58:09

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] soc: 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: Qiang Zhao <[email protected]>
Cc: Li Yang <[email protected]>
Cc: Andy Gross <[email protected]>
Cc: David Brown <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Jonathan Hunter <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/soc/dove/pmu.c | 8 +++---
drivers/soc/fsl/qe/qe_tdm.c | 4 +--
drivers/soc/qcom/apr.c | 2 +-
drivers/soc/rockchip/pm_domains.c | 44 +++++++++++++++----------------
drivers/soc/tegra/pmc.c | 12 ++++-----
drivers/soc/ti/knav_dma.c | 8 +++---
drivers/soc/ti/knav_qmss_queue.c | 8 +++---
7 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/drivers/soc/dove/pmu.c b/drivers/soc/dove/pmu.c
index 5abb08ffb74d..ffc5311c0ed8 100644
--- a/drivers/soc/dove/pmu.c
+++ b/drivers/soc/dove/pmu.c
@@ -383,7 +383,7 @@ int __init dove_init_pmu(void)

domains_node = of_get_child_by_name(np_pmu, "domains");
if (!domains_node) {
- pr_err("%s: failed to find domains sub-node\n", np_pmu->name);
+ pr_err("%pOFn: failed to find domains sub-node\n", np_pmu);
return 0;
}

@@ -396,7 +396,7 @@ int __init dove_init_pmu(void)
pmu->pmc_base = of_iomap(pmu->of_node, 0);
pmu->pmu_base = of_iomap(pmu->of_node, 1);
if (!pmu->pmc_base || !pmu->pmu_base) {
- pr_err("%s: failed to map PMU\n", np_pmu->name);
+ pr_err("%pOFn: failed to map PMU\n", np_pmu);
iounmap(pmu->pmu_base);
iounmap(pmu->pmc_base);
kfree(pmu);
@@ -414,7 +414,7 @@ int __init dove_init_pmu(void)
break;

domain->pmu = pmu;
- domain->base.name = kstrdup(np->name, GFP_KERNEL);
+ domain->base.name = kasprintf(GFP_KERNEL, "%pOFn", np);
if (!domain->base.name) {
kfree(domain);
break;
@@ -444,7 +444,7 @@ int __init dove_init_pmu(void)
/* Loss of the interrupt controller is not a fatal error. */
parent_irq = irq_of_parse_and_map(pmu->of_node, 0);
if (!parent_irq) {
- pr_err("%s: no interrupt specified\n", np_pmu->name);
+ pr_err("%pOFn: no interrupt specified\n", np_pmu);
} else {
ret = dove_init_pmu_irq(pmu, parent_irq);
if (ret)
diff --git a/drivers/soc/fsl/qe/qe_tdm.c b/drivers/soc/fsl/qe/qe_tdm.c
index f744c214f680..f78c34647ca2 100644
--- a/drivers/soc/fsl/qe/qe_tdm.c
+++ b/drivers/soc/fsl/qe/qe_tdm.c
@@ -131,7 +131,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm,

pdev = of_find_device_by_node(np2);
if (!pdev) {
- pr_err("%s: failed to lookup pdev\n", np2->name);
+ pr_err("%pOFn: failed to lookup pdev\n", np2);
of_node_put(np2);
return -EINVAL;
}
@@ -153,7 +153,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm,
pdev = of_find_device_by_node(np2);
if (!pdev) {
ret = -EINVAL;
- pr_err("%s: failed to lookup pdev\n", np2->name);
+ pr_err("%pOFn: failed to lookup pdev\n", np2);
of_node_put(np2);
goto err_miss_siram_property;
}
diff --git a/drivers/soc/qcom/apr.c b/drivers/soc/qcom/apr.c
index 57af8a537332..4bda793ba6ae 100644
--- a/drivers/soc/qcom/apr.c
+++ b/drivers/soc/qcom/apr.c
@@ -219,7 +219,7 @@ static int apr_add_device(struct device *dev, struct device_node *np,
adev->domain_id = id->domain_id;
adev->version = id->svc_version;
if (np)
- strncpy(adev->name, np->name, APR_NAME_SIZE);
+ snprintf(adev->name, APR_NAME_SIZE, "%pOFn", np);
else
strncpy(adev->name, id->name, APR_NAME_SIZE);

diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
index 6dff8682155f..6f86a726bb45 100644
--- a/drivers/soc/rockchip/pm_domains.c
+++ b/drivers/soc/rockchip/pm_domains.c
@@ -392,21 +392,21 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
error = of_property_read_u32(node, "reg", &id);
if (error) {
dev_err(pmu->dev,
- "%s: failed to retrieve domain id (reg): %d\n",
- node->name, error);
+ "%pOFn: failed to retrieve domain id (reg): %d\n",
+ node, error);
return -EINVAL;
}

if (id >= pmu->info->num_domains) {
- dev_err(pmu->dev, "%s: invalid domain id %d\n",
- node->name, id);
+ dev_err(pmu->dev, "%pOFn: invalid domain id %d\n",
+ node, id);
return -EINVAL;
}

pd_info = &pmu->info->domain_info[id];
if (!pd_info) {
- dev_err(pmu->dev, "%s: undefined domain id %d\n",
- node->name, id);
+ dev_err(pmu->dev, "%pOFn: undefined domain id %d\n",
+ node, id);
return -EINVAL;
}

@@ -424,8 +424,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
if (!pd->clks)
return -ENOMEM;
} else {
- dev_dbg(pmu->dev, "%s: doesn't have clocks: %d\n",
- node->name, pd->num_clks);
+ dev_dbg(pmu->dev, "%pOFn: doesn't have clocks: %d\n",
+ node, pd->num_clks);
pd->num_clks = 0;
}

@@ -434,8 +434,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
if (IS_ERR(pd->clks[i].clk)) {
error = PTR_ERR(pd->clks[i].clk);
dev_err(pmu->dev,
- "%s: failed to get clk at index %d: %d\n",
- node->name, i, error);
+ "%pOFn: failed to get clk at index %d: %d\n",
+ node, i, error);
return error;
}
}
@@ -486,8 +486,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
error = rockchip_pd_power(pd, true);
if (error) {
dev_err(pmu->dev,
- "failed to power on domain '%s': %d\n",
- node->name, error);
+ "failed to power on domain '%pOFn': %d\n",
+ node, error);
goto err_unprepare_clocks;
}

@@ -575,24 +575,24 @@ static int rockchip_pm_add_subdomain(struct rockchip_pmu *pmu,
error = of_property_read_u32(parent, "reg", &idx);
if (error) {
dev_err(pmu->dev,
- "%s: failed to retrieve domain id (reg): %d\n",
- parent->name, error);
+ "%pOFn: failed to retrieve domain id (reg): %d\n",
+ parent, error);
goto err_out;
}
parent_domain = pmu->genpd_data.domains[idx];

error = rockchip_pm_add_one_domain(pmu, np);
if (error) {
- dev_err(pmu->dev, "failed to handle node %s: %d\n",
- np->name, error);
+ dev_err(pmu->dev, "failed to handle node %pOFn: %d\n",
+ np, error);
goto err_out;
}

error = of_property_read_u32(np, "reg", &idx);
if (error) {
dev_err(pmu->dev,
- "%s: failed to retrieve domain id (reg): %d\n",
- np->name, error);
+ "%pOFn: failed to retrieve domain id (reg): %d\n",
+ np, error);
goto err_out;
}
child_domain = pmu->genpd_data.domains[idx];
@@ -683,16 +683,16 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
for_each_available_child_of_node(np, node) {
error = rockchip_pm_add_one_domain(pmu, node);
if (error) {
- dev_err(dev, "failed to handle node %s: %d\n",
- node->name, error);
+ dev_err(dev, "failed to handle node %pOFn: %d\n",
+ node, error);
of_node_put(node);
goto err_out;
}

error = rockchip_pm_add_subdomain(pmu, node);
if (error < 0) {
- dev_err(dev, "failed to handle subdomain node %s: %d\n",
- node->name, error);
+ dev_err(dev, "failed to handle subdomain node %pOFn: %d\n",
+ node, error);
of_node_put(node);
goto err_out;
}
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 2d6f3fcf3211..acbe63e925d5 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -796,7 +796,7 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np)

id = tegra_powergate_lookup(pmc, np->name);
if (id < 0) {
- pr_err("powergate lookup failed for %s: %d\n", np->name, id);
+ pr_err("powergate lookup failed for %pOFn: %d\n", np, id);
goto free_mem;
}

@@ -816,13 +816,13 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np)

err = tegra_powergate_of_get_clks(pg, np);
if (err < 0) {
- pr_err("failed to get clocks for %s: %d\n", np->name, err);
+ pr_err("failed to get clocks for %pOFn: %d\n", np, err);
goto set_available;
}

err = tegra_powergate_of_get_resets(pg, np, off);
if (err < 0) {
- pr_err("failed to get resets for %s: %d\n", np->name, err);
+ pr_err("failed to get resets for %pOFn: %d\n", np, err);
goto remove_clks;
}

@@ -851,15 +851,15 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np)

err = pm_genpd_init(&pg->genpd, NULL, off);
if (err < 0) {
- pr_err("failed to initialise PM domain %s: %d\n", np->name,
+ pr_err("failed to initialise PM domain %pOFn: %d\n", np,
err);
goto remove_resets;
}

err = of_genpd_add_provider_simple(np, &pg->genpd);
if (err < 0) {
- pr_err("failed to add PM domain provider for %s: %d\n",
- np->name, err);
+ pr_err("failed to add PM domain provider for %pOFn: %d\n",
+ np, err);
goto remove_genpd;
}

diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c
index 224d7ddeeb76..bbd4e5bc8707 100644
--- a/drivers/soc/ti/knav_dma.c
+++ b/drivers/soc/ti/knav_dma.c
@@ -544,15 +544,15 @@ static void __iomem *pktdma_get_regs(struct knav_dma_device *dma,

ret = of_address_to_resource(node, index, &res);
if (ret) {
- dev_err(dev, "Can't translate of node(%s) address for index(%d)\n",
- node->name, index);
+ dev_err(dev, "Can't translate of node(%pOFn) address for index(%d)\n",
+ node, index);
return ERR_PTR(ret);
}

regs = devm_ioremap_resource(kdev->dev, &res);
if (IS_ERR(regs))
- dev_err(dev, "Failed to map register base for index(%d) node(%s)\n",
- index, node->name);
+ dev_err(dev, "Failed to map register base for index(%d) node(%pOFn)\n",
+ index, node);
if (_size)
*_size = resource_size(&res);

diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 6755f2af5619..b5d5673c255c 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -1382,15 +1382,15 @@ static void __iomem *knav_queue_map_reg(struct knav_device *kdev,

ret = of_address_to_resource(node, index, &res);
if (ret) {
- dev_err(kdev->dev, "Can't translate of node(%s) address for index(%d)\n",
- node->name, index);
+ dev_err(kdev->dev, "Can't translate of node(%pOFn) address for index(%d)\n",
+ node, index);
return ERR_PTR(ret);
}

regs = devm_ioremap_resource(kdev->dev, &res);
if (IS_ERR(regs))
- dev_err(kdev->dev, "Failed to map register base for index(%d) node(%s)\n",
- index, node->name);
+ dev_err(kdev->dev, "Failed to map register base for index(%d) node(%pOFn)\n",
+ index, node);
return regs;
}

--
2.17.1


2018-08-28 01:58:15

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] regulator: 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: Liam Girdwood <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Sangbeom Kim <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/regulator/max8997-regulator.c | 4 +-
drivers/regulator/mc13xxx-regulator-core.c | 2 +-
drivers/regulator/of_regulator.c | 44 +++++++++++-----------
drivers/regulator/qcom-rpmh-regulator.c | 14 +++----
drivers/regulator/s5m8767.c | 12 +++---
5 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/drivers/regulator/max8997-regulator.c b/drivers/regulator/max8997-regulator.c
index ad0c806b0737..3bf5ddfaaea8 100644
--- a/drivers/regulator/max8997-regulator.c
+++ b/drivers/regulator/max8997-regulator.c
@@ -929,8 +929,8 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
break;

if (i == ARRAY_SIZE(regulators)) {
- dev_warn(&pdev->dev, "don't know how to configure regulator %s\n",
- reg_np->name);
+ dev_warn(&pdev->dev, "don't know how to configure regulator %pOFn\n",
+ reg_np);
continue;
}

diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c
index da4fb9824757..65eb1e0350cf 100644
--- a/drivers/regulator/mc13xxx-regulator-core.c
+++ b/drivers/regulator/mc13xxx-regulator-core.c
@@ -203,7 +203,7 @@ struct mc13xxx_regulator_init_data *mc13xxx_parse_regulators_dt(

if (!found)
dev_warn(&pdev->dev,
- "Unknown regulator: %s\n", child->name);
+ "Unknown regulator: %pOFn\n", child);
}
of_node_put(parent);

diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 638f17d4c848..92a516b959a7 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -95,8 +95,8 @@ static void of_get_regulation_constraints(struct device_node *np,
if (!ret)
constraints->settling_time_up = pval;
if (constraints->settling_time_up && constraints->settling_time) {
- pr_warn("%s: ambiguous configuration for settling time, ignoring 'regulator-settling-time-up-us'\n",
- np->name);
+ pr_warn("%pOFn: ambiguous configuration for settling time, ignoring 'regulator-settling-time-up-us'\n",
+ np);
constraints->settling_time_up = 0;
}

@@ -105,8 +105,8 @@ static void of_get_regulation_constraints(struct device_node *np,
if (!ret)
constraints->settling_time_down = pval;
if (constraints->settling_time_down && constraints->settling_time) {
- pr_warn("%s: ambiguous configuration for settling time, ignoring 'regulator-settling-time-down-us'\n",
- np->name);
+ pr_warn("%pOFn: ambiguous configuration for settling time, ignoring 'regulator-settling-time-down-us'\n",
+ np);
constraints->settling_time_down = 0;
}

@@ -127,12 +127,12 @@ static void of_get_regulation_constraints(struct device_node *np,
if (desc && desc->of_map_mode) {
mode = desc->of_map_mode(pval);
if (mode == REGULATOR_MODE_INVALID)
- pr_err("%s: invalid mode %u\n", np->name, pval);
+ pr_err("%pOFn: invalid mode %u\n", np, pval);
else
constraints->initial_mode = mode;
} else {
- pr_warn("%s: mapping for mode %d not defined\n",
- np->name, pval);
+ pr_warn("%pOFn: mapping for mode %d not defined\n",
+ np, pval);
}
}

@@ -144,14 +144,14 @@ static void of_get_regulation_constraints(struct device_node *np,
ret = of_property_read_u32_index(np,
"regulator-allowed-modes", i, &pval);
if (ret) {
- pr_err("%s: couldn't read allowed modes index %d, ret=%d\n",
- np->name, i, ret);
+ pr_err("%pOFn: couldn't read allowed modes index %d, ret=%d\n",
+ np, i, ret);
break;
}
mode = desc->of_map_mode(pval);
if (mode == REGULATOR_MODE_INVALID)
- pr_err("%s: invalid regulator-allowed-modes element %u\n",
- np->name, pval);
+ pr_err("%pOFn: invalid regulator-allowed-modes element %u\n",
+ np, pval);
else
constraints->valid_modes_mask |= mode;
}
@@ -159,7 +159,7 @@ static void of_get_regulation_constraints(struct device_node *np,
constraints->valid_ops_mask
|= REGULATOR_CHANGE_MODE;
} else {
- pr_warn("%s: mode mapping not defined\n", np->name);
+ pr_warn("%pOFn: mode mapping not defined\n", np);
}
}

@@ -197,13 +197,13 @@ static void of_get_regulation_constraints(struct device_node *np,
if (desc && desc->of_map_mode) {
mode = desc->of_map_mode(pval);
if (mode == REGULATOR_MODE_INVALID)
- pr_err("%s: invalid mode %u\n",
- np->name, pval);
+ pr_err("%pOFn: invalid mode %u\n",
+ np, pval);
else
suspend_state->mode = mode;
} else {
- pr_warn("%s: mapping for mode %d not defined\n",
- np->name, pval);
+ pr_warn("%pOFn: mapping for mode %d not defined\n",
+ np, pval);
}
}

@@ -351,8 +351,8 @@ int of_regulator_match(struct device *dev, struct device_node *node,
match->desc);
if (!match->init_data) {
dev_err(dev,
- "failed to parse DT for regulator %s\n",
- child->name);
+ "failed to parse DT for regulator %pOFn\n",
+ child);
of_node_put(child);
return -EINVAL;
}
@@ -401,16 +401,16 @@ struct regulator_init_data *regulator_of_get_init_data(struct device *dev,
init_data = of_get_regulator_init_data(dev, child, desc);
if (!init_data) {
dev_err(dev,
- "failed to parse DT for regulator %s\n",
- child->name);
+ "failed to parse DT for regulator %pOFn\n",
+ child);
break;
}

if (desc->of_parse_cb) {
if (desc->of_parse_cb(child, desc, config)) {
dev_err(dev,
- "driver callback failed to parse DT for regulator %s\n",
- child->name);
+ "driver callback failed to parse DT for regulator %pOFn\n",
+ child);
init_data = NULL;
break;
}
diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
index 9f27daebd8c8..301e7f695374 100644
--- a/drivers/regulator/qcom-rpmh-regulator.c
+++ b/drivers/regulator/qcom-rpmh-regulator.c
@@ -414,7 +414,7 @@ static int rpmh_regulator_init_vreg(struct rpmh_vreg *vreg, struct device *dev,
break;

if (!rpmh_data->name) {
- dev_err(dev, "Unknown regulator %s\n", node->name);
+ dev_err(dev, "Unknown regulator %pOFn\n", node);
return -EINVAL;
}

@@ -423,8 +423,8 @@ static int rpmh_regulator_init_vreg(struct rpmh_vreg *vreg, struct device *dev,

vreg->addr = cmd_db_read_addr(rpmh_resource_name);
if (!vreg->addr) {
- dev_err(dev, "%s: could not find RPMh address for resource %s\n",
- node->name, rpmh_resource_name);
+ dev_err(dev, "%pOFn: could not find RPMh address for resource %s\n",
+ node, rpmh_resource_name);
return -ENODEV;
}

@@ -469,13 +469,13 @@ static int rpmh_regulator_init_vreg(struct rpmh_vreg *vreg, struct device *dev,
rdev = devm_regulator_register(dev, &vreg->rdesc, &reg_config);
if (IS_ERR(rdev)) {
ret = PTR_ERR(rdev);
- dev_err(dev, "%s: devm_regulator_register() failed, ret=%d\n",
- node->name, ret);
+ dev_err(dev, "%pOFn: devm_regulator_register() failed, ret=%d\n",
+ node, ret);
return ret;
}

- dev_dbg(dev, "%s regulator registered for RPMh resource %s @ 0x%05X\n",
- node->name, rpmh_resource_name, vreg->addr);
+ dev_dbg(dev, "%pOFn regulator registered for RPMh resource %s @ 0x%05X\n",
+ node, rpmh_resource_name, vreg->addr);

return 0;
}
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 667d16dc83ce..09a97a7093e8 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -447,15 +447,15 @@ static void s5m8767_regulator_config_ext_control(struct s5m8767_info *s5m8767,
}
if (mode != S5M8767_ENCTRL_USE_GPIO) {
dev_warn(s5m8767->dev,
- "ext-control for %s: mismatched op_mode (%x), ignoring\n",
- rdata->reg_node->name, mode);
+ "ext-control for %pOFn: mismatched op_mode (%x), ignoring\n",
+ rdata->reg_node, mode);
return;
}

if (!rdata->ext_control_gpiod) {
dev_warn(s5m8767->dev,
- "ext-control for %s: GPIO not valid, ignoring\n",
- rdata->reg_node->name);
+ "ext-control for %pOFn: GPIO not valid, ignoring\n",
+ rdata->reg_node);
return;
}

@@ -566,8 +566,8 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,

if (i == ARRAY_SIZE(regulators)) {
dev_warn(iodev->dev,
- "don't know how to configure regulator %s\n",
- reg_np->name);
+ "don't know how to configure regulator %pOFn\n",
+ reg_np);
continue;
}

--
2.17.1


2018-08-28 01:58:22

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] rpmsg: 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: Ohad Ben-Cohen <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/rpmsg/qcom_glink_smem.c | 2 +-
drivers/rpmsg/qcom_smd.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c
index 2b5cf2790954..ab23da3d7131 100644
--- a/drivers/rpmsg/qcom_glink_smem.c
+++ b/drivers/rpmsg/qcom_glink_smem.c
@@ -205,7 +205,7 @@ struct qcom_glink *qcom_glink_smem_register(struct device *parent,
dev->parent = parent;
dev->of_node = node;
dev->release = qcom_glink_smem_release;
- dev_set_name(dev, "%s:%s", node->parent->name, node->name);
+ dev_set_name(dev, "%pOFn:%pOFn", node->parent, node);
ret = device_register(dev);
if (ret) {
pr_err("failed to register glink edge\n");
diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 8da83a4ebadc..0dae7c9f4a8f 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -1454,7 +1454,7 @@ struct qcom_smd_edge *qcom_smd_register_edge(struct device *parent,
edge->dev.release = qcom_smd_edge_release;
edge->dev.of_node = node;
edge->dev.groups = qcom_smd_edge_groups;
- dev_set_name(&edge->dev, "%s:%s", dev_name(parent), node->name);
+ dev_set_name(&edge->dev, "%s:%pOFn", dev_name(parent), node);
ret = device_register(&edge->dev);
if (ret) {
pr_err("failed to register smd edge\n");
--
2.17.1


2018-08-28 01:58:24

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] staging: 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: Steve Longerbeam <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/staging/media/imx/imx-media-dev.c | 11 ++++++-----
drivers/staging/media/imx/imx-media-of.c | 4 ++--
drivers/staging/mt7621-eth/mdio.c | 4 ++--
3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c
index b0be80f05767..818846f8c291 100644
--- a/drivers/staging/media/imx/imx-media-dev.c
+++ b/drivers/staging/media/imx/imx-media-dev.c
@@ -89,8 +89,8 @@ int imx_media_add_async_subdev(struct imx_media_dev *imxmd,

/* return -EEXIST if this asd already added */
if (find_async_subdev(imxmd, fwnode, devname)) {
- dev_dbg(imxmd->md.dev, "%s: already added %s\n",
- __func__, np ? np->name : devname);
+ dev_dbg(imxmd->md.dev, "%s: already added %pOFn\n",
+ __func__, np ? np : devname);
ret = -EEXIST;
goto out;
}
@@ -105,19 +105,20 @@ int imx_media_add_async_subdev(struct imx_media_dev *imxmd,
if (fwnode) {
asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
asd->match.fwnode = fwnode;
+ dev_dbg(imxmd->md.dev, "%s: added %pOFn, match type FWNODE\n",
+ __func__, np);
} else {
asd->match_type = V4L2_ASYNC_MATCH_DEVNAME;
asd->match.device_name = devname;
imxasd->pdev = pdev;
+ dev_dbg(imxmd->md.dev, "%s: added %s, match type DEVNAME\n",
+ __func__, devname);
}

list_add_tail(&imxasd->list, &imxmd->asd_list);

imxmd->subdev_notifier.num_subdevs++;

- dev_dbg(imxmd->md.dev, "%s: added %s, match type %s\n",
- __func__, np ? np->name : devname, np ? "FWNODE" : "DEVNAME");
-
out:
mutex_unlock(&imxmd->mutex);
return ret;
diff --git a/drivers/staging/media/imx/imx-media-of.c b/drivers/staging/media/imx/imx-media-of.c
index acde372c6795..cb74df356576 100644
--- a/drivers/staging/media/imx/imx-media-of.c
+++ b/drivers/staging/media/imx/imx-media-of.c
@@ -79,8 +79,8 @@ of_parse_subdev(struct imx_media_dev *imxmd, struct device_node *sd_np,
int i, num_ports, ret;

if (!of_device_is_available(sd_np)) {
- dev_dbg(imxmd->md.dev, "%s: %s not enabled\n", __func__,
- sd_np->name);
+ dev_dbg(imxmd->md.dev, "%pOFn: %s not enabled\n", __func__,
+ sd_np);
/* unavailable is not an error */
return 0;
}
diff --git a/drivers/staging/mt7621-eth/mdio.c b/drivers/staging/mt7621-eth/mdio.c
index 7ad0c4141205..9ffa8f771235 100644
--- a/drivers/staging/mt7621-eth/mdio.c
+++ b/drivers/staging/mt7621-eth/mdio.c
@@ -70,7 +70,7 @@ int mtk_connect_phy_node(struct mtk_eth *eth, struct mtk_mac *mac,
_port = of_get_property(phy_node, "reg", NULL);

if (!_port || (be32_to_cpu(*_port) >= 0x20)) {
- pr_err("%s: invalid port id\n", phy_node->name);
+ pr_err("%pOFn: invalid port id\n", phy_node);
return -EINVAL;
}
port = be32_to_cpu(*_port);
@@ -249,7 +249,7 @@ int mtk_mdio_init(struct mtk_eth *eth)
eth->mii_bus->priv = eth;
eth->mii_bus->parent = eth->dev;

- snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%s", mii_np->name);
+ snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%pOFn", mii_np);
err = of_mdiobus_register(eth->mii_bus, mii_np);
if (err)
goto err_free_bus;
--
2.17.1


2018-08-28 01:58:30

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] net: ethernet: 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: "David S. Miller" <[email protected]>
Cc: Yisen Zhuang <[email protected]>
Cc: Salil Mehta <[email protected]>
Cc: Sebastian Hesselbarth <[email protected]>
Cc: Felix Fietkau <[email protected]>
Cc: John Crispin <[email protected]>
Cc: Sean Wang <[email protected]>
Cc: Nelson Chang <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: Wingman Kwok <[email protected]>
Cc: Murali Karicheri <[email protected]>
Cc: [email protected]

Signed-off-by: Rob Herring <[email protected]>
---
drivers/net/ethernet/freescale/fsl_pq_mdio.c | 4 +-
.../net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 8 ++--
drivers/net/ethernet/marvell/mv643xx_eth.c | 6 +--
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
drivers/net/ethernet/sun/sunhme.c | 2 +-
drivers/net/ethernet/ti/netcp_core.c | 22 ++++------
drivers/net/ethernet/ti/netcp_ethss.c | 42 +++++++++----------
7 files changed, 40 insertions(+), 46 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
index ac2c3f6a12bc..82722d05fedb 100644
--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
+++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
@@ -446,8 +446,8 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev)
goto error;
}

- snprintf(new_bus->id, MII_BUS_ID_SIZE, "%s@%llx", np->name,
- (unsigned long long)res.start);
+ snprintf(new_bus->id, MII_BUS_ID_SIZE, "%pOFn@%llx", np,
+ (unsigned long long)res.start);

priv->map = of_iomap(np, 0);
if (!priv->map) {
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index 1c2326bd76e2..6521d8d53745 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -807,8 +807,8 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
*/
put_device(&mac_cb->phy_dev->mdio.dev);

- dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
- mac_cb->mac_id, np->name);
+ dev_dbg(mac_cb->dev, "mac%d phy_node: %pOFn\n",
+ mac_cb->mac_id, np);
}
of_node_put(np);

@@ -825,8 +825,8 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
* if the phy_dev is found
*/
put_device(&mac_cb->phy_dev->mdio.dev);
- dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
- mac_cb->mac_id, np->name);
+ dev_dbg(mac_cb->dev, "mac%d phy_node: %pOFn\n",
+ mac_cb->mac_id, np);
}
of_node_put(np);

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 62f204f32316..1e9bcbdc6a90 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2733,17 +2733,17 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,

memset(&res, 0, sizeof(res));
if (of_irq_to_resource(pnp, 0, &res) <= 0) {
- dev_err(&pdev->dev, "missing interrupt on %s\n", pnp->name);
+ dev_err(&pdev->dev, "missing interrupt on %pOFn\n", pnp);
return -EINVAL;
}

if (of_property_read_u32(pnp, "reg", &ppd.port_number)) {
- dev_err(&pdev->dev, "missing reg property on %s\n", pnp->name);
+ dev_err(&pdev->dev, "missing reg property on %pOFn\n", pnp);
return -EINVAL;
}

if (ppd.port_number >= 3) {
- dev_err(&pdev->dev, "invalid reg property on %s\n", pnp->name);
+ dev_err(&pdev->dev, "invalid reg property on %pOFn\n", pnp);
return -EINVAL;
}

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 6e6abdc399de..b44bcfd85b05 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -405,7 +405,7 @@ static int mtk_mdio_init(struct mtk_eth *eth)
eth->mii_bus->priv = eth;
eth->mii_bus->parent = eth->dev;

- snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%s", mii_np->name);
+ snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%pOFn", mii_np);
ret = of_mdiobus_register(eth->mii_bus, mii_np);

err_put_node:
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index 06da2f59fcbf..863fd602fd33 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -2999,7 +2999,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
/* Now make sure pci_dev cookie is there. */
#ifdef CONFIG_SPARC
dp = pci_device_to_OF_node(pdev);
- strcpy(prom_name, dp->name);
+ snprintf(prom_name, sizeof(prom_name), "%pOFn", dp);
#else
if (is_quattro_p(pdev))
strcpy(prom_name, "SUNW,qfe");
diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
index a1d335a3c5e4..cb240e0d515a 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -225,17 +225,6 @@ static int emac_arch_get_mac_addr(char *x, void __iomem *efuse_mac, u32 swap)
return 0;
}

-static const char *netcp_node_name(struct device_node *node)
-{
- const char *name;
-
- if (of_property_read_string(node, "label", &name) < 0)
- name = node->name;
- if (!name)
- name = "unknown";
- return name;
-}
-
/* Module management routines */
static int netcp_register_interface(struct netcp_intf *netcp)
{
@@ -267,7 +256,12 @@ static int netcp_module_probe(struct netcp_device *netcp_device,
}

for_each_available_child_of_node(devices, child) {
- const char *name = netcp_node_name(child);
+ const char *name;
+ char node_name[32];
+
+ if (of_property_read_string(node, "label", &name) < 0)
+ snprintf(node_name, sizeof(node_name), "%pOFn", child);
+ name = node_name;

if (!strcasecmp(module->name, name))
break;
@@ -2209,8 +2203,8 @@ static int netcp_probe(struct platform_device *pdev)
for_each_available_child_of_node(interfaces, child) {
ret = netcp_create_interface(netcp_device, child);
if (ret) {
- dev_err(dev, "could not create interface(%s)\n",
- child->name);
+ dev_err(dev, "could not create interface(%pOFn)\n",
+ child);
goto probe_quit_interface;
}
}
diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index 72b98e27c992..0397ccb6597e 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -3137,15 +3137,15 @@ static void init_secondary_ports(struct gbe_priv *gbe_dev,
for_each_child_of_node(node, port) {
slave = devm_kzalloc(dev, sizeof(*slave), GFP_KERNEL);
if (!slave) {
- dev_err(dev, "memory alloc failed for secondary port(%s), skipping...\n",
- port->name);
+ dev_err(dev, "memory alloc failed for secondary port(%pOFn), skipping...\n",
+ port);
continue;
}

if (init_slave(gbe_dev, slave, port)) {
dev_err(dev,
- "Failed to initialize secondary port(%s), skipping...\n",
- port->name);
+ "Failed to initialize secondary port(%pOFn), skipping...\n",
+ port);
devm_kfree(dev, slave);
continue;
}
@@ -3239,8 +3239,8 @@ static int set_xgbe_ethss10_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, XGBE_SS_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't xlate xgbe of node(%s) ss address at %d\n",
- node->name, XGBE_SS_REG_INDEX);
+ "Can't xlate xgbe of node(%pOFn) ss address at %d\n",
+ node, XGBE_SS_REG_INDEX);
return ret;
}

@@ -3254,8 +3254,8 @@ static int set_xgbe_ethss10_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, XGBE_SM_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't xlate xgbe of node(%s) sm address at %d\n",
- node->name, XGBE_SM_REG_INDEX);
+ "Can't xlate xgbe of node(%pOFn) sm address at %d\n",
+ node, XGBE_SM_REG_INDEX);
return ret;
}

@@ -3269,8 +3269,8 @@ static int set_xgbe_ethss10_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, XGBE_SERDES_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't xlate xgbe serdes of node(%s) address at %d\n",
- node->name, XGBE_SERDES_REG_INDEX);
+ "Can't xlate xgbe serdes of node(%pOFn) address at %d\n",
+ node, XGBE_SERDES_REG_INDEX);
return ret;
}

@@ -3347,8 +3347,8 @@ static int get_gbe_resource_version(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, GBE_SS_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't translate of node(%s) of gbe ss address at %d\n",
- node->name, GBE_SS_REG_INDEX);
+ "Can't translate of node(%pOFn) of gbe ss address at %d\n",
+ node, GBE_SS_REG_INDEX);
return ret;
}

@@ -3372,8 +3372,8 @@ static int set_gbe_ethss14_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, GBE_SGMII34_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't translate of gbe node(%s) address at index %d\n",
- node->name, GBE_SGMII34_REG_INDEX);
+ "Can't translate of gbe node(%pOFn) address at index %d\n",
+ node, GBE_SGMII34_REG_INDEX);
return ret;
}

@@ -3388,8 +3388,8 @@ static int set_gbe_ethss14_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, GBE_SM_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't translate of gbe node(%s) address at index %d\n",
- node->name, GBE_SM_REG_INDEX);
+ "Can't translate of gbe node(%pOFn) address at index %d\n",
+ node, GBE_SM_REG_INDEX);
return ret;
}

@@ -3498,8 +3498,8 @@ static int set_gbenu_ethss_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, GBENU_SM_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't translate of gbenu node(%s) addr at index %d\n",
- node->name, GBENU_SM_REG_INDEX);
+ "Can't translate of gbenu node(%pOFn) addr at index %d\n",
+ node, GBENU_SM_REG_INDEX);
return ret;
}

@@ -3642,7 +3642,7 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
ret = netcp_xgbe_serdes_init(gbe_dev->xgbe_serdes_regs,
gbe_dev->ss_regs);
} else {
- dev_err(dev, "unknown GBE node(%s)\n", node->name);
+ dev_err(dev, "unknown GBE node(%pOFn)\n", node);
ret = -ENODEV;
}

@@ -3667,8 +3667,8 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
for_each_child_of_node(interfaces, interface) {
ret = of_property_read_u32(interface, "slave-port", &slave_num);
if (ret) {
- dev_err(dev, "missing slave-port parameter, skipping interface configuration for %s\n",
- interface->name);
+ dev_err(dev, "missing slave-port parameter, skipping interface configuration for %pOFn\n",
+ interface);
continue;
}
gbe_dev->num_slaves++;
--
2.17.1


2018-08-28 01:58:31

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] thermal: 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: Zhang Rui <[email protected]>
Cc: Eduardo Valentin <[email protected]>
Cc: Daniel Lezcano <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/thermal/of-thermal.c | 10 +++++-----
drivers/thermal/qoriq_thermal.c | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index 977a8307fbb1..e201ae1c382f 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -483,8 +483,8 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data,
if (sensor_specs.args_count >= 1) {
id = sensor_specs.args[0];
WARN(sensor_specs.args_count > 1,
- "%s: too many cells in sensor specifier %d\n",
- sensor_specs.np->name, sensor_specs.args_count);
+ "%pOFn: too many cells in sensor specifier %d\n",
+ sensor_specs.np, sensor_specs.args_count);
} else {
id = 0;
}
@@ -960,8 +960,8 @@ int __init of_parse_thermal_zones(void)

tz = thermal_of_build_thermal_zone(child);
if (IS_ERR(tz)) {
- pr_err("failed to build thermal zone %s: %ld\n",
- child->name,
+ pr_err("failed to build thermal zone %pOFn: %ld\n",
+ child,
PTR_ERR(tz));
continue;
}
@@ -995,7 +995,7 @@ int __init of_parse_thermal_zones(void)
tz->passive_delay,
tz->polling_delay);
if (IS_ERR(zone)) {
- pr_err("Failed to build %s zone %ld\n", child->name,
+ pr_err("Failed to build %pOFn zone %ld\n", child,
PTR_ERR(zone));
kfree(tzp);
kfree(ops);
diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index c866cc165960..1fa132fc316b 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -129,8 +129,8 @@ static int qoriq_tmu_get_sensor_id(void)
if (sensor_specs.args_count >= 1) {
id = sensor_specs.args[0];
WARN(sensor_specs.args_count > 1,
- "%s: too many cells in sensor specifier %d\n",
- sensor_specs.np->name, sensor_specs.args_count);
+ "%pOFn: too many cells in sensor specifier %d\n",
+ sensor_specs.np, sensor_specs.args_count);
} else {
id = 0;
}
--
2.17.1


2018-08-28 01:58:41

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] net: phy: 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: Andrew Lunn <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/net/phy/mdio-thunder.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/mdio-thunder.c b/drivers/net/phy/mdio-thunder.c
index 564616968cad..1546f6398831 100644
--- a/drivers/net/phy/mdio-thunder.c
+++ b/drivers/net/phy/mdio-thunder.c
@@ -73,8 +73,8 @@ static int thunder_mdiobus_pci_probe(struct pci_dev *pdev,
err = of_address_to_resource(node, 0, &r);
if (err) {
dev_err(&pdev->dev,
- "Couldn't translate address for \"%s\"\n",
- node->name);
+ "Couldn't translate address for \"%pOFn\"\n",
+ node);
break;
}

--
2.17.1


2018-08-28 01:58:50

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] mmc: 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: Adrian Hunter <[email protected]>
Cc: Hu Ziji <[email protected]>
Cc: Ulf Hansson <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/mmc/host/sdhci-xenon-phy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c
index c335052d0c02..5956e90380e8 100644
--- a/drivers/mmc/host/sdhci-xenon-phy.c
+++ b/drivers/mmc/host/sdhci-xenon-phy.c
@@ -660,8 +660,8 @@ static int get_dt_pad_ctrl_data(struct sdhci_host *host,
return 0;

if (of_address_to_resource(np, 1, &iomem)) {
- dev_err(mmc_dev(host->mmc), "Unable to find SoC PAD ctrl register address for %s\n",
- np->name);
+ dev_err(mmc_dev(host->mmc), "Unable to find SoC PAD ctrl register address for %pOFn\n",
+ np);
return -EINVAL;
}

--
2.17.1


2018-08-28 01:58:51

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] perf: 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: Will Deacon <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/perf/arm_pmu_platform.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
index 96075cecb0ae..933bd8410fc2 100644
--- a/drivers/perf/arm_pmu_platform.c
+++ b/drivers/perf/arm_pmu_platform.c
@@ -77,14 +77,14 @@ static int pmu_parse_irq_affinity(struct device_node *node, int i)

dn = of_parse_phandle(node, "interrupt-affinity", i);
if (!dn) {
- pr_warn("failed to parse interrupt-affinity[%d] for %s\n",
- i, node->name);
+ pr_warn("failed to parse interrupt-affinity[%d] for %pOFn\n",
+ i, node);
return -EINVAL;
}

cpu = of_cpu_node_to_id(dn);
if (cpu < 0) {
- pr_warn("failed to find logical CPU for %s\n", dn->name);
+ pr_warn("failed to find logical CPU for %pOFn\n", dn);
cpu = nr_cpu_ids;
}

--
2.17.1


2018-08-28 01:58:55

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] memory: 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: Roger Quadros <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Jonathan Hunter <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/memory/omap-gpmc.c | 18 +++++++-----------
drivers/memory/samsung/exynos-srom.c | 4 ++--
drivers/memory/tegra/mc.c | 6 +++---
drivers/memory/tegra/tegra124-emc.c | 12 ++++++------
4 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index c215287e80cf..8abb9e94916a 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -2145,8 +2145,8 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
gpmc_s.device_width = GPMC_DEVWIDTH_16BIT;
break;
default:
- dev_err(&pdev->dev, "%s: invalid 'nand-bus-width'\n",
- child->name);
+ dev_err(&pdev->dev, "%pOFn: invalid 'nand-bus-width'\n",
+ child);
ret = -EINVAL;
goto err;
}
@@ -2186,8 +2186,8 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,

ret = gpmc_cs_set_timings(cs, &gpmc_t, &gpmc_s);
if (ret) {
- dev_err(&pdev->dev, "failed to set gpmc timings for: %s\n",
- child->name);
+ dev_err(&pdev->dev, "failed to set gpmc timings for: %pOFn\n",
+ child);
goto err_cs;
}

@@ -2215,7 +2215,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,

err_child_fail:

- dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name);
+ dev_err(&pdev->dev, "failed to create gpmc child %pOFn\n", child);
ret = -ENODEV;

err_cs:
@@ -2265,14 +2265,10 @@ static void gpmc_probe_dt_children(struct platform_device *pdev)
struct device_node *child;

for_each_available_child_of_node(pdev->dev.of_node, child) {
-
- if (!child->name)
- continue;
-
ret = gpmc_probe_generic_child(pdev, child);
if (ret) {
- dev_err(&pdev->dev, "failed to probe DT child '%s': %d\n",
- child->name, ret);
+ dev_err(&pdev->dev, "failed to probe DT child '%pOFn': %d\n",
+ child, ret);
}
}
}
diff --git a/drivers/memory/samsung/exynos-srom.c b/drivers/memory/samsung/exynos-srom.c
index 7edd7fb540f2..c27c6105c66d 100644
--- a/drivers/memory/samsung/exynos-srom.c
+++ b/drivers/memory/samsung/exynos-srom.c
@@ -139,8 +139,8 @@ static int exynos_srom_probe(struct platform_device *pdev)
for_each_child_of_node(np, child) {
if (exynos_srom_configure_bank(srom, child)) {
dev_err(dev,
- "Could not decode bank configuration for %s\n",
- child->name);
+ "Could not decode bank configuration for %pOFn\n",
+ child);
bad_bank_config = true;
}
}
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index bd25faf6d13d..24afc36833bf 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -345,7 +345,7 @@ static int load_one_timing(struct tegra_mc *mc,
err = of_property_read_u32(node, "clock-frequency", &tmp);
if (err) {
dev_err(mc->dev,
- "timing %s: failed to read rate\n", node->name);
+ "timing %pOFn: failed to read rate\n", node);
return err;
}

@@ -360,8 +360,8 @@ static int load_one_timing(struct tegra_mc *mc,
mc->soc->num_emem_regs);
if (err) {
dev_err(mc->dev,
- "timing %s: failed to read EMEM configuration\n",
- node->name);
+ "timing %pOFn: failed to read EMEM configuration\n",
+ node);
return err;
}

diff --git a/drivers/memory/tegra/tegra124-emc.c b/drivers/memory/tegra/tegra124-emc.c
index 392dc8dd481f..eedb7d48e2ea 100644
--- a/drivers/memory/tegra/tegra124-emc.c
+++ b/drivers/memory/tegra/tegra124-emc.c
@@ -888,8 +888,8 @@ static int load_one_timing_from_dt(struct tegra_emc *emc,

err = of_property_read_u32(node, "clock-frequency", &value);
if (err) {
- dev_err(emc->dev, "timing %s: failed to read rate: %d\n",
- node->name, err);
+ dev_err(emc->dev, "timing %pOFn: failed to read rate: %d\n",
+ node, err);
return err;
}

@@ -900,16 +900,16 @@ static int load_one_timing_from_dt(struct tegra_emc *emc,
ARRAY_SIZE(timing->emc_burst_data));
if (err) {
dev_err(emc->dev,
- "timing %s: failed to read emc burst data: %d\n",
- node->name, err);
+ "timing %pOFn: failed to read emc burst data: %d\n",
+ node, err);
return err;
}

#define EMC_READ_PROP(prop, dtprop) { \
err = of_property_read_u32(node, dtprop, &timing->prop); \
if (err) { \
- dev_err(emc->dev, "timing %s: failed to read " #prop ": %d\n", \
- node->name, err); \
+ dev_err(emc->dev, "timing %pOFn: failed to read " #prop ": %d\n", \
+ node, err); \
return err; \
} \
}
--
2.17.1


2018-08-28 01:59:00

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] net: wireless: ath: 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: Kalle Valo <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/net/wireless/ath/ath6kl/init.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 58fb227a849f..54132af70094 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -710,8 +710,8 @@ static bool check_device_tree(struct ath6kl *ar)
for_each_compatible_node(node, NULL, "atheros,ath6kl") {
board_id = of_get_property(node, board_id_prop, NULL);
if (board_id == NULL) {
- ath6kl_warn("No \"%s\" property on %s node.\n",
- board_id_prop, node->name);
+ ath6kl_warn("No \"%s\" property on %pOFn node.\n",
+ board_id_prop, node);
continue;
}
snprintf(board_filename, sizeof(board_filename),
--
2.17.1


2018-08-28 01:59:04

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] nvmem: 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: Srinivas Kandagatla <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
---
drivers/nvmem/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index aa1657831b70..6988ee9f11ba 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -304,6 +304,7 @@ static void nvmem_cell_drop(struct nvmem_cell *cell)
mutex_lock(&nvmem_cells_mutex);
list_del(&cell->node);
mutex_unlock(&nvmem_cells_mutex);
+ kfree(cell->name);
kfree(cell);
}

@@ -879,7 +880,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
cell->nvmem = nvmem;
cell->offset = be32_to_cpup(addr++);
cell->bytes = be32_to_cpup(addr);
- cell->name = cell_np->name;
+ cell->name = kasprintf(GFP_KERNEL, "%pOFn", cell_np);

addr = of_get_property(cell_np, "bits", &len);
if (addr && len == (2 * sizeof(u32))) {
@@ -904,6 +905,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
return cell;

err_sanity:
+ kfree(cell->name);
kfree(cell);

err_mem:
--
2.17.1


2018-08-28 01:59:20

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] media: 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: Mauro Carvalho Chehab <[email protected]>
Cc: "Lad, Prabhakar" <[email protected]>
Cc: Benoit Parrot <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: Hyun Kwon <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/media/i2c/tvp5150.c | 8 ++++----
drivers/media/platform/davinci/vpif_capture.c | 3 +--
drivers/media/platform/ti-vpe/cal.c | 8 ++++----
drivers/media/platform/video-mux.c | 2 +-
drivers/media/platform/xilinx/xilinx-dma.c | 8 ++++----
5 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 76e6bed5a1da..f337e523821b 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -1403,8 +1403,8 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
ret = of_property_read_u32(child, "input", &input_type);
if (ret) {
dev_err(decoder->sd.dev,
- "missing type property in node %s\n",
- child->name);
+ "missing type property in node %pOFn\n",
+ child);
goto err_connector;
}

@@ -1439,8 +1439,8 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
ret = of_property_read_string(child, "label", &name);
if (ret < 0) {
dev_err(decoder->sd.dev,
- "missing label property in node %s\n",
- child->name);
+ "missing label property in node %pOFn\n",
+ child);
goto err_connector;
}

diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index a96f53ce8088..35fc69591d54 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1583,8 +1583,7 @@ vpif_capture_get_pdata(struct platform_device *pdev)
goto done;
}

- dev_dbg(&pdev->dev, "Remote device %s, %pOF found\n",
- rem->name, rem);
+ dev_dbg(&pdev->dev, "Remote device %pOF found\n", rem);
sdinfo->name = rem->full_name;

pdata->asd[i] = devm_kzalloc(&pdev->dev,
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index d1febe5baa6d..77d755020e78 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -1712,8 +1712,8 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
v4l2_fwnode_endpoint_parse(of_fwnode_handle(remote_ep), endpoint);

if (endpoint->bus_type != V4L2_MBUS_CSI2) {
- ctx_err(ctx, "Port:%d sub-device %s is not a CSI2 device\n",
- inst, sensor_node->name);
+ ctx_err(ctx, "Port:%d sub-device %pOFn is not a CSI2 device\n",
+ inst, sensor_node);
goto cleanup_exit;
}

@@ -1732,8 +1732,8 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
endpoint->bus.mipi_csi2.data_lanes[lane]);
ctx_dbg(3, ctx, "\t>\n");

- ctx_dbg(1, ctx, "Port: %d found sub-device %s\n",
- inst, sensor_node->name);
+ ctx_dbg(1, ctx, "Port: %d found sub-device %pOFn\n",
+ inst, sensor_node);

ctx->asd_list[0] = asd;
ctx->notifier.subdevs = ctx->asd_list;
diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c
index c01e1592ad0a..61a9bf716a05 100644
--- a/drivers/media/platform/video-mux.c
+++ b/drivers/media/platform/video-mux.c
@@ -333,7 +333,7 @@ static int video_mux_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, vmux);

v4l2_subdev_init(&vmux->subdev, &video_mux_subdev_ops);
- snprintf(vmux->subdev.name, sizeof(vmux->subdev.name), "%s", np->name);
+ snprintf(vmux->subdev.name, sizeof(vmux->subdev.name), "%pOFn", np);
vmux->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
vmux->subdev.dev = dev;

diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
index d041f94be832..3c8fcf951c63 100644
--- a/drivers/media/platform/xilinx/xilinx-dma.c
+++ b/drivers/media/platform/xilinx/xilinx-dma.c
@@ -506,8 +506,8 @@ xvip_dma_querycap(struct file *file, void *fh, struct v4l2_capability *cap)

strlcpy(cap->driver, "xilinx-vipp", sizeof(cap->driver));
strlcpy(cap->card, dma->video.name, sizeof(cap->card));
- snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s:%u",
- dma->xdev->dev->of_node->name, dma->port);
+ snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%pOFn:%u",
+ dma->xdev->dev->of_node, dma->port);

return 0;
}
@@ -693,8 +693,8 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,
dma->video.fops = &xvip_dma_fops;
dma->video.v4l2_dev = &xdev->v4l2_dev;
dma->video.queue = &dma->queue;
- snprintf(dma->video.name, sizeof(dma->video.name), "%s %s %u",
- xdev->dev->of_node->name,
+ snprintf(dma->video.name, sizeof(dma->video.name), "%pOFn %s %u",
+ xdev->dev->of_node,
type == V4L2_BUF_TYPE_VIDEO_CAPTURE ? "output" : "input",
port);
dma->video.vfl_type = VFL_TYPE_GRABBER;
--
2.17.1


2018-08-28 01:59:24

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] pinctrl: 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: Linus Walleij <[email protected]>
Cc: Dong Aisheng <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Sean Wang <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: Carlo Caione <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Gregory Clement <[email protected]>
Cc: Sebastian Hesselbarth <[email protected]>
Cc: Jean-Christophe Plagniol-Villard <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: Haojian Zhuang <[email protected]>
Cc: Patrice Chotard <[email protected]>
Cc: Barry Song <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Chen-Yu Tsai <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/pinctrl/berlin/berlin.c | 6 ++--
drivers/pinctrl/freescale/pinctrl-imx.c | 7 ++--
drivers/pinctrl/freescale/pinctrl-imx1-core.c | 12 +++----
drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 +--
drivers/pinctrl/meson/pinctrl-meson.c | 2 +-
drivers/pinctrl/mvebu/pinctrl-mvebu.c | 4 +--
drivers/pinctrl/nomadik/pinctrl-nomadik.c | 6 ++--
drivers/pinctrl/pinctrl-at91.c | 8 ++---
drivers/pinctrl/pinctrl-lantiq.c | 8 ++---
drivers/pinctrl/pinctrl-rockchip.c | 8 ++---
drivers/pinctrl/pinctrl-rza1.c | 8 ++---
drivers/pinctrl/pinctrl-single.c | 32 +++++++++----------
drivers/pinctrl/pinctrl-st.c | 6 ++--
drivers/pinctrl/sirf/pinctrl-atlas7.c | 4 +--
drivers/pinctrl/stm32/pinctrl-stm32.c | 4 +--
drivers/pinctrl/sunxi/pinctrl-sunxi.c | 8 ++---
drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 8 ++---
17 files changed, 66 insertions(+), 69 deletions(-)

diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
index b5903fffb3d0..b17a03cf87be 100644
--- a/drivers/pinctrl/berlin/berlin.c
+++ b/drivers/pinctrl/berlin/berlin.c
@@ -64,16 +64,14 @@ static int berlin_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrl_dev,
ret = of_property_read_string(node, "function", &function_name);
if (ret) {
dev_err(pctrl->dev,
- "missing function property in node %s\n",
- node->name);
+ "missing function property in node %pOFn\n", node);
return -EINVAL;
}

ngroups = of_property_count_strings(node, "groups");
if (ngroups < 0) {
dev_err(pctrl->dev,
- "missing groups property in node %s\n",
- node->name);
+ "missing groups property in node %pOFn\n", node);
return -EINVAL;
}

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index b04edc22dad7..4e8cf0e357c6 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -69,8 +69,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
*/
grp = imx_pinctrl_find_group_by_name(pctldev, np->name);
if (!grp) {
- dev_err(ipctl->dev, "unable to find group for node %s\n",
- np->name);
+ dev_err(ipctl->dev, "unable to find group for node %pOFn\n", np);
return -EINVAL;
}

@@ -434,7 +433,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
int i;
u32 config;

- dev_dbg(ipctl->dev, "group(%d): %s\n", index, np->name);
+ dev_dbg(ipctl->dev, "group(%d): %pOFn\n", index, np);

if (info->flags & SHARE_MUX_CONF_REG)
pin_size = FSL_PIN_SHARE_SIZE;
@@ -544,7 +543,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
struct group_desc *grp;
u32 i = 0;

- dev_dbg(pctl->dev, "parse function(%d): %s\n", index, np->name);
+ dev_dbg(pctl->dev, "parse function(%d): %pOFn\n", index, np);

func = pinmux_generic_get_function(pctl, index);
if (!func)
diff --git a/drivers/pinctrl/freescale/pinctrl-imx1-core.c b/drivers/pinctrl/freescale/pinctrl-imx1-core.c
index deb7870b3d1a..7e29e3fecdb2 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx1-core.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx1-core.c
@@ -233,8 +233,8 @@ static int imx1_dt_node_to_map(struct pinctrl_dev *pctldev,
*/
grp = imx1_pinctrl_find_group_by_name(info, np->name);
if (!grp) {
- dev_err(info->dev, "unable to find group for node %s\n",
- np->name);
+ dev_err(info->dev, "unable to find group for node %pOFn\n",
+ np);
return -EINVAL;
}

@@ -466,7 +466,7 @@ static int imx1_pinctrl_parse_groups(struct device_node *np,
const __be32 *list;
int i;

- dev_dbg(info->dev, "group(%d): %s\n", index, np->name);
+ dev_dbg(info->dev, "group(%d): %pOFn\n", index, np);

/* Initialise group */
grp->name = np->name;
@@ -477,8 +477,8 @@ static int imx1_pinctrl_parse_groups(struct device_node *np,
list = of_get_property(np, "fsl,pins", &size);
/* we do not check return since it's safe node passed down */
if (!size || size % 12) {
- dev_notice(info->dev, "Not a valid fsl,pins property (%s)\n",
- np->name);
+ dev_notice(info->dev, "Not a valid fsl,pins property (%pOFn)\n",
+ np);
return -EINVAL;
}

@@ -513,7 +513,7 @@ static int imx1_pinctrl_parse_functions(struct device_node *np,
static u32 grp_index;
u32 i = 0;

- dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name);
+ dev_dbg(info->dev, "parse function(%d): %pOFn\n", index, np);

func = &info->functions[index];

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 16ff56f93501..071623873ca5 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -514,8 +514,8 @@ static int mtk_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,

pins = of_find_property(node, "pinmux", NULL);
if (!pins) {
- dev_err(pctl->dev, "missing pins property in node %s .\n",
- node->name);
+ dev_err(pctl->dev, "missing pins property in node %pOFn .\n",
+ node);
return -EINVAL;
}

diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index 29a458da78db..9cb81aec4e3b 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -451,7 +451,7 @@ static struct regmap *meson_map_resource(struct meson_pinctrl *pc,

meson_regmap_config.max_register = resource_size(&res) - 4;
meson_regmap_config.name = devm_kasprintf(pc->dev, GFP_KERNEL,
- "%s-%s", node->name,
+ "%pOFn-%s", node,
name);
if (!meson_regmap_config.name)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
index d7ec7119701b..7ee5f7970585 100644
--- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c
+++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
@@ -413,14 +413,14 @@ static int mvebu_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
ret = of_property_read_string(np, "marvell,function", &function);
if (ret) {
dev_err(pctl->dev,
- "missing marvell,function in node %s\n", np->name);
+ "missing marvell,function in node %pOFn\n", np);
return 0;
}

nmaps = of_property_count_strings(np, "marvell,pins");
if (nmaps < 0) {
dev_err(pctl->dev,
- "missing marvell,pins in node %s\n", np->name);
+ "missing marvell,pins in node %pOFn\n", np);
return 0;
}

diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
index f0e7a8c114b2..866db2706b8b 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -1051,7 +1051,7 @@ static struct nmk_gpio_chip *nmk_gpio_populate_chip(struct device_node *np,

gpio_pdev = of_find_device_by_node(np);
if (!gpio_pdev) {
- pr_err("populate \"%s\": device not found\n", np->name);
+ pr_err("populate \"%pOFn\": device not found\n", np);
return ERR_PTR(-ENODEV);
}
if (of_property_read_u32(np, "gpio-bank", &id)) {
@@ -1904,8 +1904,8 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
gpio_np = of_parse_phandle(np, "nomadik-gpio-chips", i);
if (gpio_np) {
dev_info(&pdev->dev,
- "populate NMK GPIO %d \"%s\"\n",
- i, gpio_np->name);
+ "populate NMK GPIO %d \"%pOFn\"\n",
+ i, gpio_np);
nmk_chip = nmk_gpio_populate_chip(gpio_np, pdev);
if (IS_ERR(nmk_chip))
dev_err(&pdev->dev,
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 50f0ec42c637..cfd8239f2727 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -263,8 +263,8 @@ static int at91_dt_node_to_map(struct pinctrl_dev *pctldev,
*/
grp = at91_pinctrl_find_group_by_name(info, np->name);
if (!grp) {
- dev_err(info->dev, "unable to find group for node %s\n",
- np->name);
+ dev_err(info->dev, "unable to find group for node %pOFn\n",
+ np);
return -EINVAL;
}

@@ -1071,7 +1071,7 @@ static int at91_pinctrl_parse_groups(struct device_node *np,
const __be32 *list;
int i, j;

- dev_dbg(info->dev, "group(%d): %s\n", index, np->name);
+ dev_dbg(info->dev, "group(%d): %pOFn\n", index, np);

/* Initialise group */
grp->name = np->name;
@@ -1122,7 +1122,7 @@ static int at91_pinctrl_parse_functions(struct device_node *np,
static u32 grp_index;
u32 i = 0;

- dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name);
+ dev_dbg(info->dev, "parse function(%d): %pOFn\n", index, np);

func = &info->functions[index];

diff --git a/drivers/pinctrl/pinctrl-lantiq.c b/drivers/pinctrl/pinctrl-lantiq.c
index 81632af3a86a..22e80613e269 100644
--- a/drivers/pinctrl/pinctrl-lantiq.c
+++ b/drivers/pinctrl/pinctrl-lantiq.c
@@ -80,14 +80,14 @@ static void ltq_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
int ret, i;

if (!pins && !groups) {
- dev_err(pctldev->dev, "%s defines neither pins nor groups\n",
- np->name);
+ dev_err(pctldev->dev, "%pOFn defines neither pins nor groups\n",
+ np);
return;
}

if (pins && groups) {
- dev_err(pctldev->dev, "%s defines both pins and groups\n",
- np->name);
+ dev_err(pctldev->dev, "%pOFn defines both pins and groups\n",
+ np);
return;
}

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index f4a61429e06e..1fe72af3717b 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -501,8 +501,8 @@ static int rockchip_dt_node_to_map(struct pinctrl_dev *pctldev,
*/
grp = pinctrl_name_to_group(info, np->name);
if (!grp) {
- dev_err(info->dev, "unable to find group for node %s\n",
- np->name);
+ dev_err(info->dev, "unable to find group for node %pOFn\n",
+ np);
return -EINVAL;
}

@@ -2454,7 +2454,7 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np,
int i, j;
int ret;

- dev_dbg(info->dev, "group(%d): %s\n", index, np->name);
+ dev_dbg(info->dev, "group(%d): %pOFn\n", index, np);

/* Initialise group */
grp->name = np->name;
@@ -2519,7 +2519,7 @@ static int rockchip_pinctrl_parse_functions(struct device_node *np,
static u32 grp_index;
u32 i = 0;

- dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name);
+ dev_dbg(info->dev, "parse function(%d): %pOFn\n", index, np);

func = &info->functions[index];

diff --git a/drivers/pinctrl/pinctrl-rza1.c b/drivers/pinctrl/pinctrl-rza1.c
index f76edf664539..042ede3b8ada 100644
--- a/drivers/pinctrl/pinctrl-rza1.c
+++ b/drivers/pinctrl/pinctrl-rza1.c
@@ -930,8 +930,8 @@ static int rza1_parse_pinmux_node(struct rza1_pinctrl *rza1_pctl,
&npin_configs);
if (ret) {
dev_err(rza1_pctl->dev,
- "Unable to parse pin configuration options for %s\n",
- np->name);
+ "Unable to parse pin configuration options for %pOFn\n",
+ np);
return ret;
}

@@ -1226,8 +1226,8 @@ static int rza1_parse_gpiochip(struct rza1_pinctrl *rza1_pctl,

*chip = rza1_gpiochip_template;
chip->base = -1;
- chip->label = devm_kasprintf(rza1_pctl->dev, GFP_KERNEL, "%s",
- np->name);
+ chip->label = devm_kasprintf(rza1_pctl->dev, GFP_KERNEL, "%pOFn",
+ np);
chip->ngpio = of_args.args[2];
chip->of_node = np;
chip->parent = rza1_pctl->dev;
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 7ec72ff2419a..1e0614daee9b 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1022,14 +1022,14 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
vals[found].reg = pcs->base + offset;
vals[found].val = pinctrl_spec.args[1];

- dev_dbg(pcs->dev, "%s index: 0x%x value: 0x%x\n",
- pinctrl_spec.np->name, offset, pinctrl_spec.args[1]);
+ dev_dbg(pcs->dev, "%pOFn index: 0x%x value: 0x%x\n",
+ pinctrl_spec.np, offset, pinctrl_spec.args[1]);

pin = pcs_get_pin_by_offset(pcs, offset);
if (pin < 0) {
dev_err(pcs->dev,
- "could not add functions for %s %ux\n",
- np->name, offset);
+ "could not add functions for %pOFn %ux\n",
+ np, offset);
break;
}
pins[found++] = pin;
@@ -1135,8 +1135,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
val = pinctrl_spec.args[1];
mask = pinctrl_spec.args[2];

- dev_dbg(pcs->dev, "%s index: 0x%x value: 0x%x mask: 0x%x\n",
- pinctrl_spec.np->name, offset, val, mask);
+ dev_dbg(pcs->dev, "%pOFn index: 0x%x value: 0x%x mask: 0x%x\n",
+ pinctrl_spec.np, offset, val, mask);

/* Parse pins in each row from LSB */
while (mask) {
@@ -1148,8 +1148,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,

if ((mask & mask_pos) == 0) {
dev_err(pcs->dev,
- "Invalid mask for %s at 0x%x\n",
- np->name, offset);
+ "Invalid mask for %pOFn at 0x%x\n",
+ np, offset);
break;
}

@@ -1157,8 +1157,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,

if (submask != mask_pos) {
dev_warn(pcs->dev,
- "Invalid submask 0x%x for %s at 0x%x\n",
- submask, np->name, offset);
+ "Invalid submask 0x%x for %pOFn at 0x%x\n",
+ submask, np, offset);
continue;
}

@@ -1169,8 +1169,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
pin = pcs_get_pin_by_offset(pcs, offset);
if (pin < 0) {
dev_err(pcs->dev,
- "could not add functions for %s %ux\n",
- np->name, offset);
+ "could not add functions for %pOFn %ux\n",
+ np, offset);
break;
}
pins[found++] = pin + pin_num_from_lsb;
@@ -1254,16 +1254,16 @@ static int pcs_dt_node_to_map(struct pinctrl_dev *pctldev,
ret = pcs_parse_bits_in_pinctrl_entry(pcs, np_config, map,
num_maps, pgnames);
if (ret < 0) {
- dev_err(pcs->dev, "no pins entries for %s\n",
- np_config->name);
+ dev_err(pcs->dev, "no pins entries for %pOFn\n",
+ np_config);
goto free_pgnames;
}
} else {
ret = pcs_parse_one_pinctrl_entry(pcs, np_config, map,
num_maps, pgnames);
if (ret < 0) {
- dev_err(pcs->dev, "no pins entries for %s\n",
- np_config->name);
+ dev_err(pcs->dev, "no pins entries for %pOFn\n",
+ np_config);
goto free_pgnames;
}
}
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index 0966bb0bf71f..e66af93f2cbf 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -817,8 +817,8 @@ static int st_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,

grp = st_pctl_find_group_by_name(info, np->name);
if (!grp) {
- dev_err(info->dev, "unable to find group for node %s\n",
- np->name);
+ dev_err(info->dev, "unable to find group for node %pOFn\n",
+ np);
return -EINVAL;
}

@@ -1184,7 +1184,7 @@ static int st_pctl_dt_parse_groups(struct device_node *np,
if (pp->length / sizeof(__be32) >= OF_GPIO_ARGS_MIN) {
npins++;
} else {
- pr_warn("Invalid st,pins in %s node\n", np->name);
+ pr_warn("Invalid st,pins in %pOFn node\n", np);
return -EINVAL;
}
}
diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c
index 3abb028f6158..1d16df128b1a 100644
--- a/drivers/pinctrl/sirf/pinctrl-atlas7.c
+++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c
@@ -6058,8 +6058,8 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
ret = gpiochip_add_data(chip, a7gc);
if (ret) {
dev_err(&pdev->dev,
- "%s: error in probe function with status %d\n",
- np->name, ret);
+ "%pOF: error in probe function with status %d\n",
+ np, ret);
goto failed;
}

diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index a9bec6e6fdd1..0fbfcc9ea07c 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -416,8 +416,8 @@ static int stm32_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,

pins = of_find_property(node, "pinmux", NULL);
if (!pins) {
- dev_err(pctl->dev, "missing pins property in node %s .\n",
- node->name);
+ dev_err(pctl->dev, "missing pins property in node %pOFn .\n",
+ node);
return -EINVAL;
}

diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index 4d9bf9b3e9f3..3ccbe221e024 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -332,15 +332,15 @@ static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev,

function = sunxi_pctrl_parse_function_prop(node);
if (!function) {
- dev_err(pctl->dev, "missing function property in node %s\n",
- node->name);
+ dev_err(pctl->dev, "missing function property in node %pOFn\n",
+ node);
return -EINVAL;
}

pin_prop = sunxi_pctrl_find_pins_prop(node, &npins);
if (!pin_prop) {
- dev_err(pctl->dev, "missing pins property in node %s\n",
- node->name);
+ dev_err(pctl->dev, "missing pins property in node %pOFn\n",
+ node);
return -EINVAL;
}

diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index 8782c348ebe9..a4bc506a01a3 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -452,8 +452,8 @@ static int ti_iodelay_node_iterator(struct pinctrl_dev *pctldev,

pin = ti_iodelay_offset_to_pin(iod, cfg[pin_index].offset);
if (pin < 0) {
- dev_err(iod->dev, "could not add functions for %s %ux\n",
- np->name, cfg[pin_index].offset);
+ dev_err(iod->dev, "could not add functions for %pOFn %ux\n",
+ np, cfg[pin_index].offset);
return -ENODEV;
}
pins[pin_index] = pin;
@@ -461,8 +461,8 @@ static int ti_iodelay_node_iterator(struct pinctrl_dev *pctldev,
pd = &iod->pa[pin];
pd->drv_data = &cfg[pin_index];

- dev_dbg(iod->dev, "%s offset=%x a_delay = %d g_delay = %d\n",
- np->name, cfg[pin_index].offset, cfg[pin_index].a_delay,
+ dev_dbg(iod->dev, "%pOFn offset=%x a_delay = %d g_delay = %d\n",
+ np, cfg[pin_index].offset, cfg[pin_index].a_delay,
cfg[pin_index].g_delay);

return 0;
--
2.17.1


2018-08-28 01:59:24

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] misc: 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: Frederic Barrat <[email protected]>
Cc: Andrew Donnellan <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/misc/cxl/flash.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/cxl/flash.c b/drivers/misc/cxl/flash.c
index 43917898fb9a..4d6836f19489 100644
--- a/drivers/misc/cxl/flash.c
+++ b/drivers/misc/cxl/flash.c
@@ -92,8 +92,8 @@ static int update_property(struct device_node *dn, const char *name,

val = (u32 *)new_prop->value;
rc = cxl_update_properties(dn, new_prop);
- pr_devel("%s: update property (%s, length: %i, value: %#x)\n",
- dn->name, name, vd, be32_to_cpu(*val));
+ pr_devel("%pOFn: update property (%s, length: %i, value: %#x)\n",
+ dn, name, vd, be32_to_cpu(*val));

if (rc) {
kfree(new_prop->name);
--
2.17.1


2018-08-28 01:59:27

by Rob Herring (Arm)

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

Signed-off-by: Rob Herring <[email protected]>
---
drivers/firmware/scpi_pm_domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/scpi_pm_domain.c b/drivers/firmware/scpi_pm_domain.c
index f395dec27113..390aa13391e4 100644
--- a/drivers/firmware/scpi_pm_domain.c
+++ b/drivers/firmware/scpi_pm_domain.c
@@ -121,7 +121,7 @@ static int scpi_pm_domain_probe(struct platform_device *pdev)

scpi_pd->domain = i;
scpi_pd->ops = scpi_ops;
- sprintf(scpi_pd->name, "%s.%d", np->name, i);
+ sprintf(scpi_pd->name, "%pOFn.%d", np, i);
scpi_pd->genpd.name = scpi_pd->name;
scpi_pd->genpd.power_off = scpi_pd_power_off;
scpi_pd->genpd.power_on = scpi_pd_power_on;
--
2.17.1


2018-08-28 01:59:28

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] mfd: max77620: 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: Lee Jones <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
---
drivers/mfd/max77620.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c
index b1700b5fa640..d8217366ed36 100644
--- a/drivers/mfd/max77620.c
+++ b/drivers/mfd/max77620.c
@@ -285,7 +285,7 @@ static int max77620_config_fps(struct max77620_chip *chip,
}

if (fps_id == MAX77620_FPS_COUNT) {
- dev_err(dev, "FPS node name %s is not valid\n", fps_np->name);
+ dev_err(dev, "FPS node name %pOFn is not valid\n", fps_np);
return -EINVAL;
}

--
2.17.1


2018-08-28 01:59:42

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] irqchip: 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: Thomas Gleixner <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/irqchip/irq-gic-v3.c | 4 ++--
drivers/irqchip/irq-mscc-ocelot.c | 6 +++---
drivers/irqchip/irq-orion.c | 22 +++++++++++-----------
drivers/irqchip/irq-stm32-exti.c | 6 +++---
drivers/irqchip/irq-tango.c | 10 +++++-----
drivers/irqchip/irq-tb10x.c | 18 +++++++++---------
6 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index d5912f1ec884..fcb6227ff5ac 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -1183,8 +1183,8 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node)

part->partition_id = of_node_to_fwnode(child_part);

- pr_info("GIC: PPI partition %s[%d] { ",
- child_part->name, part_idx);
+ pr_info("GIC: PPI partition %pOFn[%d] { ",
+ child_part, part_idx);

n = of_property_count_elems_of_size(child_part, "affinity",
sizeof(u32));
diff --git a/drivers/irqchip/irq-mscc-ocelot.c b/drivers/irqchip/irq-mscc-ocelot.c
index b63e40c00a02..88143c0b700c 100644
--- a/drivers/irqchip/irq-mscc-ocelot.c
+++ b/drivers/irqchip/irq-mscc-ocelot.c
@@ -72,7 +72,7 @@ static int __init ocelot_irq_init(struct device_node *node,
domain = irq_domain_add_linear(node, OCELOT_NR_IRQ,
&irq_generic_chip_ops, NULL);
if (!domain) {
- pr_err("%s: unable to add irq domain\n", node->name);
+ pr_err("%pOFn: unable to add irq domain\n", node);
return -ENOMEM;
}

@@ -80,14 +80,14 @@ static int __init ocelot_irq_init(struct device_node *node,
"icpu", handle_level_irq,
0, 0, 0);
if (ret) {
- pr_err("%s: unable to alloc irq domain gc\n", node->name);
+ pr_err("%pOFn: unable to alloc irq domain gc\n", node);
goto err_domain_remove;
}

gc = irq_get_domain_generic_chip(domain, 0);
gc->reg_base = of_iomap(node, 0);
if (!gc->reg_base) {
- pr_err("%s: unable to map resource\n", node->name);
+ pr_err("%pOFn: unable to map resource\n", node);
ret = -ENOMEM;
goto err_gc_free;
}
diff --git a/drivers/irqchip/irq-orion.c b/drivers/irqchip/irq-orion.c
index be4c5a8c9659..c4b5ffb61954 100644
--- a/drivers/irqchip/irq-orion.c
+++ b/drivers/irqchip/irq-orion.c
@@ -64,14 +64,14 @@ static int __init orion_irq_init(struct device_node *np,
num_chips * ORION_IRQS_PER_CHIP,
&irq_generic_chip_ops, NULL);
if (!orion_irq_domain)
- panic("%s: unable to add irq domain\n", np->name);
+ panic("%pOFn: unable to add irq domain\n", np);

ret = irq_alloc_domain_generic_chips(orion_irq_domain,
- ORION_IRQS_PER_CHIP, 1, np->name,
+ ORION_IRQS_PER_CHIP, 1, np->full_name,
handle_level_irq, clr, 0,
IRQ_GC_INIT_MASK_CACHE);
if (ret)
- panic("%s: unable to alloc irq domain gc\n", np->name);
+ panic("%pOFn: unable to alloc irq domain gc\n", np);

for (n = 0, base = 0; n < num_chips; n++, base += ORION_IRQS_PER_CHIP) {
struct irq_chip_generic *gc =
@@ -80,12 +80,12 @@ static int __init orion_irq_init(struct device_node *np,
of_address_to_resource(np, n, &r);

if (!request_mem_region(r.start, resource_size(&r), np->name))
- panic("%s: unable to request mem region %d",
- np->name, n);
+ panic("%pOFn: unable to request mem region %d",
+ np, n);

gc->reg_base = ioremap(r.start, resource_size(&r));
if (!gc->reg_base)
- panic("%s: unable to map resource %d", np->name, n);
+ panic("%pOFn: unable to map resource %d", np, n);

gc->chip_types[0].regs.mask = ORION_IRQ_MASK;
gc->chip_types[0].chip.irq_mask = irq_gc_mask_clr_bit;
@@ -150,20 +150,20 @@ static int __init orion_bridge_irq_init(struct device_node *np,
domain = irq_domain_add_linear(np, nrirqs,
&irq_generic_chip_ops, NULL);
if (!domain) {
- pr_err("%s: unable to add irq domain\n", np->name);
+ pr_err("%pOFn: unable to add irq domain\n", np);
return -ENOMEM;
}

ret = irq_alloc_domain_generic_chips(domain, nrirqs, 1, np->name,
handle_edge_irq, clr, 0, IRQ_GC_INIT_MASK_CACHE);
if (ret) {
- pr_err("%s: unable to alloc irq domain gc\n", np->name);
+ pr_err("%pOFn: unable to alloc irq domain gc\n", np);
return ret;
}

ret = of_address_to_resource(np, 0, &r);
if (ret) {
- pr_err("%s: unable to get resource\n", np->name);
+ pr_err("%pOFn: unable to get resource\n", np);
return ret;
}

@@ -175,14 +175,14 @@ static int __init orion_bridge_irq_init(struct device_node *np,
/* Map the parent interrupt for the chained handler */
irq = irq_of_parse_and_map(np, 0);
if (irq <= 0) {
- pr_err("%s: unable to parse irq\n", np->name);
+ pr_err("%pOFn: unable to parse irq\n", np);
return -EINVAL;
}

gc = irq_get_domain_generic_chip(domain, 0);
gc->reg_base = ioremap(r.start, resource_size(&r));
if (!gc->reg_base) {
- pr_err("%s: unable to map resource\n", np->name);
+ pr_err("%pOFn: unable to map resource\n", np);
return -ENOMEM;
}

diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c
index 0a2088e12d96..363385750fa7 100644
--- a/drivers/irqchip/irq-stm32-exti.c
+++ b/drivers/irqchip/irq-stm32-exti.c
@@ -678,8 +678,8 @@ static int __init stm32_exti_init(const struct stm32_exti_drv_data *drv_data,
domain = irq_domain_add_linear(node, drv_data->bank_nr * IRQS_PER_BANK,
&irq_exti_domain_ops, NULL);
if (!domain) {
- pr_err("%s: Could not register interrupt domain.\n",
- node->name);
+ pr_err("%pOFn: Could not register interrupt domain.\n",
+ node);
ret = -ENOMEM;
goto out_unmap;
}
@@ -768,7 +768,7 @@ __init stm32_exti_hierarchy_init(const struct stm32_exti_drv_data *drv_data,
host_data);

if (!domain) {
- pr_err("%s: Could not register exti domain.\n", node->name);
+ pr_err("%pOFn: Could not register exti domain.\n", node);
ret = -ENOMEM;
goto out_unmap;
}
diff --git a/drivers/irqchip/irq-tango.c b/drivers/irqchip/irq-tango.c
index 580e2d72b9ba..ae28d8648679 100644
--- a/drivers/irqchip/irq-tango.c
+++ b/drivers/irqchip/irq-tango.c
@@ -184,11 +184,11 @@ static int __init tangox_irq_init(void __iomem *base, struct resource *baseres,

irq = irq_of_parse_and_map(node, 0);
if (!irq)
- panic("%s: failed to get IRQ", node->name);
+ panic("%pOFn: failed to get IRQ", node);

err = of_address_to_resource(node, 0, &res);
if (err)
- panic("%s: failed to get address", node->name);
+ panic("%pOFn: failed to get address", node);

chip = kzalloc(sizeof(*chip), GFP_KERNEL);
chip->ctl = res.start - baseres->start;
@@ -196,12 +196,12 @@ static int __init tangox_irq_init(void __iomem *base, struct resource *baseres,

dom = irq_domain_add_linear(node, 64, &irq_generic_chip_ops, chip);
if (!dom)
- panic("%s: failed to create irqdomain", node->name);
+ panic("%pOFn: failed to create irqdomain", node);

err = irq_alloc_domain_generic_chips(dom, 32, 2, node->name,
handle_level_irq, 0, 0, 0);
if (err)
- panic("%s: failed to allocate irqchip", node->name);
+ panic("%pOFn: failed to allocate irqchip", node);

tangox_irq_domain_init(dom);

@@ -219,7 +219,7 @@ static int __init tangox_of_irq_init(struct device_node *node,

base = of_iomap(node, 0);
if (!base)
- panic("%s: of_iomap failed", node->name);
+ panic("%pOFn: of_iomap failed", node);

of_address_to_resource(node, 0, &res);

diff --git a/drivers/irqchip/irq-tb10x.c b/drivers/irqchip/irq-tb10x.c
index 848d782a2a3b..7e6708099a7b 100644
--- a/drivers/irqchip/irq-tb10x.c
+++ b/drivers/irqchip/irq-tb10x.c
@@ -115,21 +115,21 @@ static int __init of_tb10x_init_irq(struct device_node *ictl,
void __iomem *reg_base;

if (of_address_to_resource(ictl, 0, &mem)) {
- pr_err("%s: No registers declared in DeviceTree.\n",
- ictl->name);
+ pr_err("%pOFn: No registers declared in DeviceTree.\n",
+ ictl);
return -EINVAL;
}

if (!request_mem_region(mem.start, resource_size(&mem),
- ictl->name)) {
- pr_err("%s: Request mem region failed.\n", ictl->name);
+ ictl->full_name)) {
+ pr_err("%pOFn: Request mem region failed.\n", ictl);
return -EBUSY;
}

reg_base = ioremap(mem.start, resource_size(&mem));
if (!reg_base) {
ret = -EBUSY;
- pr_err("%s: ioremap failed.\n", ictl->name);
+ pr_err("%pOFn: ioremap failed.\n", ictl);
goto ioremap_fail;
}

@@ -137,8 +137,8 @@ static int __init of_tb10x_init_irq(struct device_node *ictl,
&irq_generic_chip_ops, NULL);
if (!domain) {
ret = -ENOMEM;
- pr_err("%s: Could not register interrupt domain.\n",
- ictl->name);
+ pr_err("%pOFn: Could not register interrupt domain.\n",
+ ictl);
goto irq_domain_add_fail;
}

@@ -147,8 +147,8 @@ static int __init of_tb10x_init_irq(struct device_node *ictl,
IRQ_NOREQUEST, IRQ_NOPROBE,
IRQ_GC_INIT_MASK_CACHE);
if (ret) {
- pr_err("%s: Could not allocate generic interrupt chip.\n",
- ictl->name);
+ pr_err("%pOFn: Could not allocate generic interrupt chip.\n",
+ ictl);
goto gc_alloc_fail;
}

--
2.17.1


2018-08-28 01:59:59

by Aisheng Dong

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

> -----Original Message-----
> From: Rob Herring [mailto:[email protected]]
> Sent: Tuesday, August 28, 2018 9:53 AM
> To: [email protected]
> Cc: Linus Walleij <[email protected]>; A.s. Dong
> <[email protected]>; Fabio Estevam <[email protected]>; Shawn
> Guo <[email protected]>; Stefan Agner <[email protected]>; Pengutronix
> Kernel Team <[email protected]>; Sean Wang
> <[email protected]>; Matthias Brugger <[email protected]>;
> Carlo Caione <[email protected]>; Kevin Hilman <[email protected]>;
> Jason Cooper <[email protected]>; Andrew Lunn <[email protected]>;
> Gregory Clement <[email protected]>; Sebastian Hesselbarth
> <[email protected]>; Jean-Christophe Plagniol-Villard
> <[email protected]>; Nicolas Ferre <[email protected]>;
> Alexandre Belloni <[email protected]>; Heiko Stuebner
> <[email protected]>; Tony Lindgren <[email protected]>; Haojian Zhuang
> <[email protected]>; Patrice Chotard <[email protected]>;
> Barry Song <[email protected]>; Maxime Coquelin
> <[email protected]>; Alexandre Torgue
> <[email protected]>; Maxime Ripard <[email protected]>;
> Chen-Yu Tsai <[email protected]>; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]
> Subject: [PATCH] pinctrl: 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: Linus Walleij <[email protected]>
> Cc: Dong Aisheng <[email protected]>
> Cc: Fabio Estevam <[email protected]>
> Cc: Shawn Guo <[email protected]>
> Cc: Stefan Agner <[email protected]>
> Cc: Pengutronix Kernel Team <[email protected]>
> Cc: Sean Wang <[email protected]>
> Cc: Matthias Brugger <[email protected]>
> Cc: Carlo Caione <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Jason Cooper <[email protected]>
> Cc: Andrew Lunn <[email protected]>
> Cc: Gregory Clement <[email protected]>
> Cc: Sebastian Hesselbarth <[email protected]>
> Cc: Jean-Christophe Plagniol-Villard <[email protected]>
> Cc: Nicolas Ferre <[email protected]>
> Cc: Alexandre Belloni <[email protected]>
> Cc: Heiko Stuebner <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: Haojian Zhuang <[email protected]>
> Cc: Patrice Chotard <[email protected]>
> Cc: Barry Song <[email protected]>
> Cc: Maxime Coquelin <[email protected]>
> Cc: Alexandre Torgue <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: Chen-Yu Tsai <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/pinctrl/berlin/berlin.c | 6 ++--
> drivers/pinctrl/freescale/pinctrl-imx.c | 7 ++--
> drivers/pinctrl/freescale/pinctrl-imx1-core.c | 12 +++----

For i.MX,
Acked-by: Dong Aisheng <[email protected]>

Regards
Dong Aisheng

2018-08-28 02:00:00

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] mtd: rawnand: 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: Boris Brezillon <[email protected]>
Cc: Miquel Raynal <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Brian Norris <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/mtd/nand/raw/fsl_upm.c | 4 ++--
drivers/mtd/nand/raw/ndfc.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
index a88e2cf66e0f..ca82727eca94 100644
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ b/drivers/mtd/nand/raw/fsl_upm.c
@@ -184,8 +184,8 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
return -ENODEV;

nand_set_flash_node(&fun->chip, flash_np);
- mtd->name = kasprintf(GFP_KERNEL, "0x%llx.%s", (u64)io_res->start,
- flash_np->name);
+ mtd->name = kasprintf(GFP_KERNEL, "0x%llx.%pOFn", (u64)io_res->start,
+ flash_np);
if (!mtd->name) {
ret = -ENOMEM;
goto err;
diff --git a/drivers/mtd/nand/raw/ndfc.c b/drivers/mtd/nand/raw/ndfc.c
index 540fa1a0ea24..b193f373f235 100644
--- a/drivers/mtd/nand/raw/ndfc.c
+++ b/drivers/mtd/nand/raw/ndfc.c
@@ -174,8 +174,8 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc,
return -ENODEV;
nand_set_flash_node(chip, flash_np);

- mtd->name = kasprintf(GFP_KERNEL, "%s.%s", dev_name(&ndfc->ofdev->dev),
- flash_np->name);
+ mtd->name = kasprintf(GFP_KERNEL, "%s.%pOFn", dev_name(&ndfc->ofdev->dev),
+ flash_np);
if (!mtd->name) {
ret = -ENOMEM;
goto err;
--
2.17.1


2018-08-28 02:00:09

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] iio: 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: Jonathan Cameron <[email protected]>
Cc: Hartmut Knaack <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/iio/adc/qcom-pm8xxx-xoadc.c | 4 ++--
drivers/iio/adc/rcar-gyroadc.c | 12 ++++++------
drivers/iio/frequency/adf4350.c | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/iio/adc/qcom-pm8xxx-xoadc.c b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
index b093ecddf1a8..c30c002f1fef 100644
--- a/drivers/iio/adc/qcom-pm8xxx-xoadc.c
+++ b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
@@ -708,8 +708,8 @@ static int pm8xxx_of_xlate(struct iio_dev *indio_dev,
* mux.
*/
if (iiospec->args_count != 2) {
- dev_err(&indio_dev->dev, "wrong number of arguments for %s need 2 got %d\n",
- iiospec->np->name,
+ dev_err(&indio_dev->dev, "wrong number of arguments for %pOFn need 2 got %d\n",
+ iiospec->np,
iiospec->args_count);
return -EINVAL;
}
diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c
index dcb50172186f..4e982b51bcda 100644
--- a/drivers/iio/adc/rcar-gyroadc.c
+++ b/drivers/iio/adc/rcar-gyroadc.c
@@ -343,8 +343,8 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
for_each_child_of_node(np, child) {
of_id = of_match_node(rcar_gyroadc_child_match, child);
if (!of_id) {
- dev_err(dev, "Ignoring unsupported ADC \"%s\".",
- child->name);
+ dev_err(dev, "Ignoring unsupported ADC \"%pOFn\".",
+ child);
continue;
}

@@ -381,16 +381,16 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
ret = of_property_read_u32(child, "reg", &reg);
if (ret) {
dev_err(dev,
- "Failed to get child reg property of ADC \"%s\".\n",
- child->name);
+ "Failed to get child reg property of ADC \"%pOFn\".\n",
+ child);
return ret;
}

/* Channel number is too high. */
if (reg >= num_channels) {
dev_err(dev,
- "Only %i channels supported with %s, but reg = <%i>.\n",
- num_channels, child->name, reg);
+ "Only %i channels supported with %pOFn, but reg = <%i>.\n",
+ num_channels, child, reg);
return ret;
}
}
diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
index 6d768431d90e..f4748ff243f7 100644
--- a/drivers/iio/frequency/adf4350.c
+++ b/drivers/iio/frequency/adf4350.c
@@ -388,7 +388,7 @@ static struct adf4350_platform_data *adf4350_parse_dt(struct device *dev)
if (!pdata)
return NULL;

- strncpy(&pdata->name[0], np->name, SPI_NAME_SIZE - 1);
+ snprintf(&pdata->name[0], SPI_NAME_SIZE - 1, "%pOFn", np);

tmp = 10000;
of_property_read_u32(np, "adi,channel-spacing", &tmp);
--
2.17.1


2018-08-28 02:00:14

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] leds: 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: Sakari Ailus <[email protected]>
Cc: Jacek Anaszewski <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
drivers/leds/leds-as3645a.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
index f883616d9e60..98a69b1a43f9 100644
--- a/drivers/leds/leds-as3645a.c
+++ b/drivers/leds/leds-as3645a.c
@@ -529,7 +529,7 @@ static int as3645a_parse_node(struct as3645a *flash,
strlcpy(names->flash, name, sizeof(names->flash));
else
snprintf(names->flash, sizeof(names->flash),
- "%s:flash", node->name);
+ "%pOFn:flash", node);

rval = of_property_read_u32(flash->flash_node, "flash-timeout-us",
&cfg->flash_timeout_us);
@@ -573,7 +573,7 @@ static int as3645a_parse_node(struct as3645a *flash,
strlcpy(names->indicator, name, sizeof(names->indicator));
else
snprintf(names->indicator, sizeof(names->indicator),
- "%s:indicator", node->name);
+ "%pOFn:indicator", node);

rval = of_property_read_u32(flash->indicator_node, "led-max-microamp",
&cfg->indicator_max_ua);
--
2.17.1


2018-08-28 02:08:28

by Chanwoo Choi

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

Dear Rob,

On 2018ė…„ 08ģ›” 28ģ¼ 10:52, 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: Chanwoo Choi <[email protected]>
> Cc: MyungJoo Ham <[email protected]>
> Cc: Kyungmin Park <[email protected]>
> Cc: Kukjin Kim <[email protected]>
> Cc: Krzysztof Kozlowski <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/devfreq/event/exynos-ppmu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
> index a9c64f0d3284..c61de0bdf053 100644
> --- a/drivers/devfreq/event/exynos-ppmu.c
> +++ b/drivers/devfreq/event/exynos-ppmu.c
> @@ -535,8 +535,8 @@ static int of_get_devfreq_events(struct device_node *np,
>
> if (i == ARRAY_SIZE(ppmu_events)) {
> dev_warn(dev,
> - "don't know how to configure events : %s\n",
> - node->name);
> + "don't know how to configure events : %pOFn\n",
> + node);
> continue;
> }
>
>

Acked-by: Chanwoo Choi <[email protected]>

--
Best Regards,
Chanwoo Choi
Samsung Electronics

2018-08-28 02:36:30

by Andrew Donnellan

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

On 28/08/18 11:52, 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: Frederic Barrat <[email protected]>
> Cc: Andrew Donnellan <[email protected]>
> Cc: Arnd Bergmann <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Acked-by: Andrew Donnellan <[email protected]>


--
Andrew Donnellan OzLabs, ADL Canberra
[email protected] IBM Australia Limited


2018-08-28 03:09:17

by Bjorn Andersson

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

On Mon 27 Aug 18:52 PDT 2018, 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: Ohad Ben-Cohen <[email protected]>
> Cc: Bjorn Andersson <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Applied

Thanks,
Bjorn

> ---
> drivers/rpmsg/qcom_glink_smem.c | 2 +-
> drivers/rpmsg/qcom_smd.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c
> index 2b5cf2790954..ab23da3d7131 100644
> --- a/drivers/rpmsg/qcom_glink_smem.c
> +++ b/drivers/rpmsg/qcom_glink_smem.c
> @@ -205,7 +205,7 @@ struct qcom_glink *qcom_glink_smem_register(struct device *parent,
> dev->parent = parent;
> dev->of_node = node;
> dev->release = qcom_glink_smem_release;
> - dev_set_name(dev, "%s:%s", node->parent->name, node->name);
> + dev_set_name(dev, "%pOFn:%pOFn", node->parent, node);
> ret = device_register(dev);
> if (ret) {
> pr_err("failed to register glink edge\n");
> diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
> index 8da83a4ebadc..0dae7c9f4a8f 100644
> --- a/drivers/rpmsg/qcom_smd.c
> +++ b/drivers/rpmsg/qcom_smd.c
> @@ -1454,7 +1454,7 @@ struct qcom_smd_edge *qcom_smd_register_edge(struct device *parent,
> edge->dev.release = qcom_smd_edge_release;
> edge->dev.of_node = node;
> edge->dev.groups = qcom_smd_edge_groups;
> - dev_set_name(&edge->dev, "%s:%s", dev_name(parent), node->name);
> + dev_set_name(&edge->dev, "%s:%pOFn", dev_name(parent), node);
> ret = device_register(&edge->dev);
> if (ret) {
> pr_err("failed to register smd edge\n");
> --
> 2.17.1
>

2018-08-28 05:18:19

by Vinod Koul

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

On 27-08-18, 20:52, 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: Dan Williams <[email protected]>
> Cc: Vinod Koul <[email protected]>
> Cc: [email protected]

Applied after dropping CC list. thanks

--
~Vinod

2018-08-28 06:34:47

by Peter Rosin

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

On 2018-08-28 03:52, 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: Benjamin Herrenschmidt <[email protected]>
> Cc: Paul Mackerras <[email protected]>
> Cc: Michael Ellerman <[email protected]>
> Cc: Peter Rosin <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/i2c/busses/i2c-powermac.c | 15 ++++++++-------
> drivers/i2c/muxes/i2c-mux-gpmux.c | 4 ++--
> 2 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
> index f2a2067525ef..b706fd136ca5 100644
> --- a/drivers/i2c/busses/i2c-powermac.c
> +++ b/drivers/i2c/busses/i2c-powermac.c
> @@ -390,7 +390,6 @@ static int i2c_powermac_probe(struct platform_device *dev)
> struct pmac_i2c_bus *bus = dev_get_platdata(&dev->dev);
> struct device_node *parent = NULL;

Lose the initializer...

> struct i2c_adapter *adapter;
> - const char *basename;
> int rc;
>
> if (bus == NULL)
> @@ -407,23 +406,25 @@ static int i2c_powermac_probe(struct platform_device *dev)
> parent = of_get_parent(pmac_i2c_get_controller(bus));
> if (parent == NULL)
> return -EINVAL;
> - basename = parent->name;
> + snprintf(adapter->name, sizeof(adapter->name), "%pOFn %d",
> + parent,
> + pmac_i2c_get_channel(bus));

...and I would have written "parent, pmac_i2c_get_channel(bus));" on one line,
but maybe that's just me.

Anyway, with the initializer fix,

Reviewed-by: Peter Rosin <[email protected]>

(Wolfram, no need to split this, just take it in full.)

Cheers,
Peter

> + of_node_put(parent);
> break;
> case pmac_i2c_bus_pmu:
> - basename = "pmu";
> + snprintf(adapter->name, sizeof(adapter->name), "pmu %d",
> + pmac_i2c_get_channel(bus));
> break;
> case pmac_i2c_bus_smu:
> /* This is not what we used to do but I'm fixing drivers at
> * the same time as this change
> */
> - basename = "smu";
> + snprintf(adapter->name, sizeof(adapter->name), "smu %d",
> + pmac_i2c_get_channel(bus));
> break;
> default:
> return -EINVAL;
> }
> - snprintf(adapter->name, sizeof(adapter->name), "%s %d", basename,
> - pmac_i2c_get_channel(bus));
> - of_node_put(parent);
>
> platform_set_drvdata(dev, adapter);
> adapter->algo = &i2c_powermac_algorithm;
> diff --git a/drivers/i2c/muxes/i2c-mux-gpmux.c b/drivers/i2c/muxes/i2c-mux-gpmux.c
> index 92cf5f48afe6..f60b670deff7 100644
> --- a/drivers/i2c/muxes/i2c-mux-gpmux.c
> +++ b/drivers/i2c/muxes/i2c-mux-gpmux.c
> @@ -120,8 +120,8 @@ static int i2c_mux_probe(struct platform_device *pdev)
>
> ret = of_property_read_u32(child, "reg", &chan);
> if (ret < 0) {
> - dev_err(dev, "no reg property for node '%s'\n",
> - child->name);
> + dev_err(dev, "no reg property for node '%pOFn'\n",
> + child);
> goto err_children;
> }
>
>


2018-08-28 06:36:17

by Ian Arkver

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

Hi,

On 28/08/2018 02:52, 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: Steve Longerbeam <[email protected]>
> Cc: Philipp Zabel <[email protected]>
> Cc: Mauro Carvalho Chehab <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/staging/media/imx/imx-media-dev.c | 11 ++++++-----
> drivers/staging/media/imx/imx-media-of.c | 4 ++--
> drivers/staging/mt7621-eth/mdio.c | 4 ++--
> 3 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c
> index b0be80f05767..818846f8c291 100644
> --- a/drivers/staging/media/imx/imx-media-dev.c
> +++ b/drivers/staging/media/imx/imx-media-dev.c
> @@ -89,8 +89,8 @@ int imx_media_add_async_subdev(struct imx_media_dev *imxmd,
>
> /* return -EEXIST if this asd already added */
> if (find_async_subdev(imxmd, fwnode, devname)) {
> - dev_dbg(imxmd->md.dev, "%s: already added %s\n",
> - __func__, np ? np->name : devname);
> + dev_dbg(imxmd->md.dev, "%s: already added %pOFn\n",
> + __func__, np ? np : devname);

This won't work for the np==NULL case I think since devname is just a
string.

Regards,
Ian
> ret = -EEXIST;
> goto out;
> }
> @@ -105,19 +105,20 @@ int imx_media_add_async_subdev(struct imx_media_dev *imxmd,
> if (fwnode) {
> asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
> asd->match.fwnode = fwnode;
> + dev_dbg(imxmd->md.dev, "%s: added %pOFn, match type FWNODE\n",
> + __func__, np);
> } else {
> asd->match_type = V4L2_ASYNC_MATCH_DEVNAME;
> asd->match.device_name = devname;
> imxasd->pdev = pdev;
> + dev_dbg(imxmd->md.dev, "%s: added %s, match type DEVNAME\n",
> + __func__, devname);
> }
>
> list_add_tail(&imxasd->list, &imxmd->asd_list);
>
> imxmd->subdev_notifier.num_subdevs++;
>
> - dev_dbg(imxmd->md.dev, "%s: added %s, match type %s\n",
> - __func__, np ? np->name : devname, np ? "FWNODE" : "DEVNAME");
> -
> out:
> mutex_unlock(&imxmd->mutex);
> return ret;
> diff --git a/drivers/staging/media/imx/imx-media-of.c b/drivers/staging/media/imx/imx-media-of.c
> index acde372c6795..cb74df356576 100644
> --- a/drivers/staging/media/imx/imx-media-of.c
> +++ b/drivers/staging/media/imx/imx-media-of.c
> @@ -79,8 +79,8 @@ of_parse_subdev(struct imx_media_dev *imxmd, struct device_node *sd_np,
> int i, num_ports, ret;
>
> if (!of_device_is_available(sd_np)) {
> - dev_dbg(imxmd->md.dev, "%s: %s not enabled\n", __func__,
> - sd_np->name);
> + dev_dbg(imxmd->md.dev, "%pOFn: %s not enabled\n", __func__,
> + sd_np);
> /* unavailable is not an error */
> return 0;
> }
> diff --git a/drivers/staging/mt7621-eth/mdio.c b/drivers/staging/mt7621-eth/mdio.c
> index 7ad0c4141205..9ffa8f771235 100644
> --- a/drivers/staging/mt7621-eth/mdio.c
> +++ b/drivers/staging/mt7621-eth/mdio.c
> @@ -70,7 +70,7 @@ int mtk_connect_phy_node(struct mtk_eth *eth, struct mtk_mac *mac,
> _port = of_get_property(phy_node, "reg", NULL);
>
> if (!_port || (be32_to_cpu(*_port) >= 0x20)) {
> - pr_err("%s: invalid port id\n", phy_node->name);
> + pr_err("%pOFn: invalid port id\n", phy_node);
> return -EINVAL;
> }
> port = be32_to_cpu(*_port);
> @@ -249,7 +249,7 @@ int mtk_mdio_init(struct mtk_eth *eth)
> eth->mii_bus->priv = eth;
> eth->mii_bus->parent = eth->dev;
>
> - snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%s", mii_np->name);
> + snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%pOFn", mii_np);
> err = of_mdiobus_register(eth->mii_bus, mii_np);
> if (err)
> goto err_free_bus;
>

2018-08-28 06:56:33

by Joe Perches

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

On Mon, 2018-08-27 at 20:52 -0500, Rob Herring wrote:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
[]
> diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
[]
> @@ -738,7 +738,7 @@ static int __init _setup_clkctrl_provider(struct device_node *np)
> provider->size = size | 0xff;
> provider->node = np;
>
> - pr_debug("%s: %s: %x...%x [+%x]\n", __func__, np->parent->name,
> + pr_debug("%pOF: %s: %x...%x [+%x]\n", __func__, np->parent,

Wrong argument order

I didn't look at the rest.

2018-08-28 07:22:45

by Alexandre Belloni

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

On 27/08/2018 20:52:41-0500, 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: Linus Walleij <[email protected]>
> Cc: Dong Aisheng <[email protected]>
> Cc: Fabio Estevam <[email protected]>
> Cc: Shawn Guo <[email protected]>
> Cc: Stefan Agner <[email protected]>
> Cc: Pengutronix Kernel Team <[email protected]>
> Cc: Sean Wang <[email protected]>
> Cc: Matthias Brugger <[email protected]>
> Cc: Carlo Caione <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Jason Cooper <[email protected]>
> Cc: Andrew Lunn <[email protected]>
> Cc: Gregory Clement <[email protected]>
> Cc: Sebastian Hesselbarth <[email protected]>
> Cc: Jean-Christophe Plagniol-Villard <[email protected]>
> Cc: Nicolas Ferre <[email protected]>
> Cc: Alexandre Belloni <[email protected]>
> Cc: Heiko Stuebner <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: Haojian Zhuang <[email protected]>
> Cc: Patrice Chotard <[email protected]>
> Cc: Barry Song <[email protected]>
> Cc: Maxime Coquelin <[email protected]>
> Cc: Alexandre Torgue <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: Chen-Yu Tsai <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

For at91:
Reviewed-by: Alexandre Belloni <[email protected]>


> ---
> drivers/pinctrl/berlin/berlin.c | 6 ++--
> drivers/pinctrl/freescale/pinctrl-imx.c | 7 ++--
> drivers/pinctrl/freescale/pinctrl-imx1-core.c | 12 +++----
> drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 +--
> drivers/pinctrl/meson/pinctrl-meson.c | 2 +-
> drivers/pinctrl/mvebu/pinctrl-mvebu.c | 4 +--
> drivers/pinctrl/nomadik/pinctrl-nomadik.c | 6 ++--
> drivers/pinctrl/pinctrl-at91.c | 8 ++---
> drivers/pinctrl/pinctrl-lantiq.c | 8 ++---
> drivers/pinctrl/pinctrl-rockchip.c | 8 ++---
> drivers/pinctrl/pinctrl-rza1.c | 8 ++---
> drivers/pinctrl/pinctrl-single.c | 32 +++++++++----------
> drivers/pinctrl/pinctrl-st.c | 6 ++--
> drivers/pinctrl/sirf/pinctrl-atlas7.c | 4 +--
> drivers/pinctrl/stm32/pinctrl-stm32.c | 4 +--
> drivers/pinctrl/sunxi/pinctrl-sunxi.c | 8 ++---
> drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 8 ++---
> 17 files changed, 66 insertions(+), 69 deletions(-)
>
> diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
> index b5903fffb3d0..b17a03cf87be 100644
> --- a/drivers/pinctrl/berlin/berlin.c
> +++ b/drivers/pinctrl/berlin/berlin.c
> @@ -64,16 +64,14 @@ static int berlin_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrl_dev,
> ret = of_property_read_string(node, "function", &function_name);
> if (ret) {
> dev_err(pctrl->dev,
> - "missing function property in node %s\n",
> - node->name);
> + "missing function property in node %pOFn\n", node);
> return -EINVAL;
> }
>
> ngroups = of_property_count_strings(node, "groups");
> if (ngroups < 0) {
> dev_err(pctrl->dev,
> - "missing groups property in node %s\n",
> - node->name);
> + "missing groups property in node %pOFn\n", node);
> return -EINVAL;
> }
>
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
> index b04edc22dad7..4e8cf0e357c6 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx.c
> @@ -69,8 +69,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
> */
> grp = imx_pinctrl_find_group_by_name(pctldev, np->name);
> if (!grp) {
> - dev_err(ipctl->dev, "unable to find group for node %s\n",
> - np->name);
> + dev_err(ipctl->dev, "unable to find group for node %pOFn\n", np);
> return -EINVAL;
> }
>
> @@ -434,7 +433,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
> int i;
> u32 config;
>
> - dev_dbg(ipctl->dev, "group(%d): %s\n", index, np->name);
> + dev_dbg(ipctl->dev, "group(%d): %pOFn\n", index, np);
>
> if (info->flags & SHARE_MUX_CONF_REG)
> pin_size = FSL_PIN_SHARE_SIZE;
> @@ -544,7 +543,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
> struct group_desc *grp;
> u32 i = 0;
>
> - dev_dbg(pctl->dev, "parse function(%d): %s\n", index, np->name);
> + dev_dbg(pctl->dev, "parse function(%d): %pOFn\n", index, np);
>
> func = pinmux_generic_get_function(pctl, index);
> if (!func)
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx1-core.c b/drivers/pinctrl/freescale/pinctrl-imx1-core.c
> index deb7870b3d1a..7e29e3fecdb2 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx1-core.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx1-core.c
> @@ -233,8 +233,8 @@ static int imx1_dt_node_to_map(struct pinctrl_dev *pctldev,
> */
> grp = imx1_pinctrl_find_group_by_name(info, np->name);
> if (!grp) {
> - dev_err(info->dev, "unable to find group for node %s\n",
> - np->name);
> + dev_err(info->dev, "unable to find group for node %pOFn\n",
> + np);
> return -EINVAL;
> }
>
> @@ -466,7 +466,7 @@ static int imx1_pinctrl_parse_groups(struct device_node *np,
> const __be32 *list;
> int i;
>
> - dev_dbg(info->dev, "group(%d): %s\n", index, np->name);
> + dev_dbg(info->dev, "group(%d): %pOFn\n", index, np);
>
> /* Initialise group */
> grp->name = np->name;
> @@ -477,8 +477,8 @@ static int imx1_pinctrl_parse_groups(struct device_node *np,
> list = of_get_property(np, "fsl,pins", &size);
> /* we do not check return since it's safe node passed down */
> if (!size || size % 12) {
> - dev_notice(info->dev, "Not a valid fsl,pins property (%s)\n",
> - np->name);
> + dev_notice(info->dev, "Not a valid fsl,pins property (%pOFn)\n",
> + np);
> return -EINVAL;
> }
>
> @@ -513,7 +513,7 @@ static int imx1_pinctrl_parse_functions(struct device_node *np,
> static u32 grp_index;
> u32 i = 0;
>
> - dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name);
> + dev_dbg(info->dev, "parse function(%d): %pOFn\n", index, np);
>
> func = &info->functions[index];
>
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> index 16ff56f93501..071623873ca5 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> @@ -514,8 +514,8 @@ static int mtk_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
>
> pins = of_find_property(node, "pinmux", NULL);
> if (!pins) {
> - dev_err(pctl->dev, "missing pins property in node %s .\n",
> - node->name);
> + dev_err(pctl->dev, "missing pins property in node %pOFn .\n",
> + node);
> return -EINVAL;
> }
>
> diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
> index 29a458da78db..9cb81aec4e3b 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson.c
> @@ -451,7 +451,7 @@ static struct regmap *meson_map_resource(struct meson_pinctrl *pc,
>
> meson_regmap_config.max_register = resource_size(&res) - 4;
> meson_regmap_config.name = devm_kasprintf(pc->dev, GFP_KERNEL,
> - "%s-%s", node->name,
> + "%pOFn-%s", node,
> name);
> if (!meson_regmap_config.name)
> return ERR_PTR(-ENOMEM);
> diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
> index d7ec7119701b..7ee5f7970585 100644
> --- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c
> +++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
> @@ -413,14 +413,14 @@ static int mvebu_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
> ret = of_property_read_string(np, "marvell,function", &function);
> if (ret) {
> dev_err(pctl->dev,
> - "missing marvell,function in node %s\n", np->name);
> + "missing marvell,function in node %pOFn\n", np);
> return 0;
> }
>
> nmaps = of_property_count_strings(np, "marvell,pins");
> if (nmaps < 0) {
> dev_err(pctl->dev,
> - "missing marvell,pins in node %s\n", np->name);
> + "missing marvell,pins in node %pOFn\n", np);
> return 0;
> }
>
> diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
> index f0e7a8c114b2..866db2706b8b 100644
> --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
> +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
> @@ -1051,7 +1051,7 @@ static struct nmk_gpio_chip *nmk_gpio_populate_chip(struct device_node *np,
>
> gpio_pdev = of_find_device_by_node(np);
> if (!gpio_pdev) {
> - pr_err("populate \"%s\": device not found\n", np->name);
> + pr_err("populate \"%pOFn\": device not found\n", np);
> return ERR_PTR(-ENODEV);
> }
> if (of_property_read_u32(np, "gpio-bank", &id)) {
> @@ -1904,8 +1904,8 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
> gpio_np = of_parse_phandle(np, "nomadik-gpio-chips", i);
> if (gpio_np) {
> dev_info(&pdev->dev,
> - "populate NMK GPIO %d \"%s\"\n",
> - i, gpio_np->name);
> + "populate NMK GPIO %d \"%pOFn\"\n",
> + i, gpio_np);
> nmk_chip = nmk_gpio_populate_chip(gpio_np, pdev);
> if (IS_ERR(nmk_chip))
> dev_err(&pdev->dev,
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index 50f0ec42c637..cfd8239f2727 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -263,8 +263,8 @@ static int at91_dt_node_to_map(struct pinctrl_dev *pctldev,
> */
> grp = at91_pinctrl_find_group_by_name(info, np->name);
> if (!grp) {
> - dev_err(info->dev, "unable to find group for node %s\n",
> - np->name);
> + dev_err(info->dev, "unable to find group for node %pOFn\n",
> + np);
> return -EINVAL;
> }
>
> @@ -1071,7 +1071,7 @@ static int at91_pinctrl_parse_groups(struct device_node *np,
> const __be32 *list;
> int i, j;
>
> - dev_dbg(info->dev, "group(%d): %s\n", index, np->name);
> + dev_dbg(info->dev, "group(%d): %pOFn\n", index, np);
>
> /* Initialise group */
> grp->name = np->name;
> @@ -1122,7 +1122,7 @@ static int at91_pinctrl_parse_functions(struct device_node *np,
> static u32 grp_index;
> u32 i = 0;
>
> - dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name);
> + dev_dbg(info->dev, "parse function(%d): %pOFn\n", index, np);
>
> func = &info->functions[index];
>
> diff --git a/drivers/pinctrl/pinctrl-lantiq.c b/drivers/pinctrl/pinctrl-lantiq.c
> index 81632af3a86a..22e80613e269 100644
> --- a/drivers/pinctrl/pinctrl-lantiq.c
> +++ b/drivers/pinctrl/pinctrl-lantiq.c
> @@ -80,14 +80,14 @@ static void ltq_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
> int ret, i;
>
> if (!pins && !groups) {
> - dev_err(pctldev->dev, "%s defines neither pins nor groups\n",
> - np->name);
> + dev_err(pctldev->dev, "%pOFn defines neither pins nor groups\n",
> + np);
> return;
> }
>
> if (pins && groups) {
> - dev_err(pctldev->dev, "%s defines both pins and groups\n",
> - np->name);
> + dev_err(pctldev->dev, "%pOFn defines both pins and groups\n",
> + np);
> return;
> }
>
> diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
> index f4a61429e06e..1fe72af3717b 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c
> @@ -501,8 +501,8 @@ static int rockchip_dt_node_to_map(struct pinctrl_dev *pctldev,
> */
> grp = pinctrl_name_to_group(info, np->name);
> if (!grp) {
> - dev_err(info->dev, "unable to find group for node %s\n",
> - np->name);
> + dev_err(info->dev, "unable to find group for node %pOFn\n",
> + np);
> return -EINVAL;
> }
>
> @@ -2454,7 +2454,7 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np,
> int i, j;
> int ret;
>
> - dev_dbg(info->dev, "group(%d): %s\n", index, np->name);
> + dev_dbg(info->dev, "group(%d): %pOFn\n", index, np);
>
> /* Initialise group */
> grp->name = np->name;
> @@ -2519,7 +2519,7 @@ static int rockchip_pinctrl_parse_functions(struct device_node *np,
> static u32 grp_index;
> u32 i = 0;
>
> - dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name);
> + dev_dbg(info->dev, "parse function(%d): %pOFn\n", index, np);
>
> func = &info->functions[index];
>
> diff --git a/drivers/pinctrl/pinctrl-rza1.c b/drivers/pinctrl/pinctrl-rza1.c
> index f76edf664539..042ede3b8ada 100644
> --- a/drivers/pinctrl/pinctrl-rza1.c
> +++ b/drivers/pinctrl/pinctrl-rza1.c
> @@ -930,8 +930,8 @@ static int rza1_parse_pinmux_node(struct rza1_pinctrl *rza1_pctl,
> &npin_configs);
> if (ret) {
> dev_err(rza1_pctl->dev,
> - "Unable to parse pin configuration options for %s\n",
> - np->name);
> + "Unable to parse pin configuration options for %pOFn\n",
> + np);
> return ret;
> }
>
> @@ -1226,8 +1226,8 @@ static int rza1_parse_gpiochip(struct rza1_pinctrl *rza1_pctl,
>
> *chip = rza1_gpiochip_template;
> chip->base = -1;
> - chip->label = devm_kasprintf(rza1_pctl->dev, GFP_KERNEL, "%s",
> - np->name);
> + chip->label = devm_kasprintf(rza1_pctl->dev, GFP_KERNEL, "%pOFn",
> + np);
> chip->ngpio = of_args.args[2];
> chip->of_node = np;
> chip->parent = rza1_pctl->dev;
> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index 7ec72ff2419a..1e0614daee9b 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -1022,14 +1022,14 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
> vals[found].reg = pcs->base + offset;
> vals[found].val = pinctrl_spec.args[1];
>
> - dev_dbg(pcs->dev, "%s index: 0x%x value: 0x%x\n",
> - pinctrl_spec.np->name, offset, pinctrl_spec.args[1]);
> + dev_dbg(pcs->dev, "%pOFn index: 0x%x value: 0x%x\n",
> + pinctrl_spec.np, offset, pinctrl_spec.args[1]);
>
> pin = pcs_get_pin_by_offset(pcs, offset);
> if (pin < 0) {
> dev_err(pcs->dev,
> - "could not add functions for %s %ux\n",
> - np->name, offset);
> + "could not add functions for %pOFn %ux\n",
> + np, offset);
> break;
> }
> pins[found++] = pin;
> @@ -1135,8 +1135,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
> val = pinctrl_spec.args[1];
> mask = pinctrl_spec.args[2];
>
> - dev_dbg(pcs->dev, "%s index: 0x%x value: 0x%x mask: 0x%x\n",
> - pinctrl_spec.np->name, offset, val, mask);
> + dev_dbg(pcs->dev, "%pOFn index: 0x%x value: 0x%x mask: 0x%x\n",
> + pinctrl_spec.np, offset, val, mask);
>
> /* Parse pins in each row from LSB */
> while (mask) {
> @@ -1148,8 +1148,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
>
> if ((mask & mask_pos) == 0) {
> dev_err(pcs->dev,
> - "Invalid mask for %s at 0x%x\n",
> - np->name, offset);
> + "Invalid mask for %pOFn at 0x%x\n",
> + np, offset);
> break;
> }
>
> @@ -1157,8 +1157,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
>
> if (submask != mask_pos) {
> dev_warn(pcs->dev,
> - "Invalid submask 0x%x for %s at 0x%x\n",
> - submask, np->name, offset);
> + "Invalid submask 0x%x for %pOFn at 0x%x\n",
> + submask, np, offset);
> continue;
> }
>
> @@ -1169,8 +1169,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
> pin = pcs_get_pin_by_offset(pcs, offset);
> if (pin < 0) {
> dev_err(pcs->dev,
> - "could not add functions for %s %ux\n",
> - np->name, offset);
> + "could not add functions for %pOFn %ux\n",
> + np, offset);
> break;
> }
> pins[found++] = pin + pin_num_from_lsb;
> @@ -1254,16 +1254,16 @@ static int pcs_dt_node_to_map(struct pinctrl_dev *pctldev,
> ret = pcs_parse_bits_in_pinctrl_entry(pcs, np_config, map,
> num_maps, pgnames);
> if (ret < 0) {
> - dev_err(pcs->dev, "no pins entries for %s\n",
> - np_config->name);
> + dev_err(pcs->dev, "no pins entries for %pOFn\n",
> + np_config);
> goto free_pgnames;
> }
> } else {
> ret = pcs_parse_one_pinctrl_entry(pcs, np_config, map,
> num_maps, pgnames);
> if (ret < 0) {
> - dev_err(pcs->dev, "no pins entries for %s\n",
> - np_config->name);
> + dev_err(pcs->dev, "no pins entries for %pOFn\n",
> + np_config);
> goto free_pgnames;
> }
> }
> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
> index 0966bb0bf71f..e66af93f2cbf 100644
> --- a/drivers/pinctrl/pinctrl-st.c
> +++ b/drivers/pinctrl/pinctrl-st.c
> @@ -817,8 +817,8 @@ static int st_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
>
> grp = st_pctl_find_group_by_name(info, np->name);
> if (!grp) {
> - dev_err(info->dev, "unable to find group for node %s\n",
> - np->name);
> + dev_err(info->dev, "unable to find group for node %pOFn\n",
> + np);
> return -EINVAL;
> }
>
> @@ -1184,7 +1184,7 @@ static int st_pctl_dt_parse_groups(struct device_node *np,
> if (pp->length / sizeof(__be32) >= OF_GPIO_ARGS_MIN) {
> npins++;
> } else {
> - pr_warn("Invalid st,pins in %s node\n", np->name);
> + pr_warn("Invalid st,pins in %pOFn node\n", np);
> return -EINVAL;
> }
> }
> diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c
> index 3abb028f6158..1d16df128b1a 100644
> --- a/drivers/pinctrl/sirf/pinctrl-atlas7.c
> +++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c
> @@ -6058,8 +6058,8 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
> ret = gpiochip_add_data(chip, a7gc);
> if (ret) {
> dev_err(&pdev->dev,
> - "%s: error in probe function with status %d\n",
> - np->name, ret);
> + "%pOF: error in probe function with status %d\n",
> + np, ret);
> goto failed;
> }
>
> diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
> index a9bec6e6fdd1..0fbfcc9ea07c 100644
> --- a/drivers/pinctrl/stm32/pinctrl-stm32.c
> +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
> @@ -416,8 +416,8 @@ static int stm32_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
>
> pins = of_find_property(node, "pinmux", NULL);
> if (!pins) {
> - dev_err(pctl->dev, "missing pins property in node %s .\n",
> - node->name);
> + dev_err(pctl->dev, "missing pins property in node %pOFn .\n",
> + node);
> return -EINVAL;
> }
>
> diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> index 4d9bf9b3e9f3..3ccbe221e024 100644
> --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> @@ -332,15 +332,15 @@ static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
>
> function = sunxi_pctrl_parse_function_prop(node);
> if (!function) {
> - dev_err(pctl->dev, "missing function property in node %s\n",
> - node->name);
> + dev_err(pctl->dev, "missing function property in node %pOFn\n",
> + node);
> return -EINVAL;
> }
>
> pin_prop = sunxi_pctrl_find_pins_prop(node, &npins);
> if (!pin_prop) {
> - dev_err(pctl->dev, "missing pins property in node %s\n",
> - node->name);
> + dev_err(pctl->dev, "missing pins property in node %pOFn\n",
> + node);
> return -EINVAL;
> }
>
> diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> index 8782c348ebe9..a4bc506a01a3 100644
> --- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> +++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> @@ -452,8 +452,8 @@ static int ti_iodelay_node_iterator(struct pinctrl_dev *pctldev,
>
> pin = ti_iodelay_offset_to_pin(iod, cfg[pin_index].offset);
> if (pin < 0) {
> - dev_err(iod->dev, "could not add functions for %s %ux\n",
> - np->name, cfg[pin_index].offset);
> + dev_err(iod->dev, "could not add functions for %pOFn %ux\n",
> + np, cfg[pin_index].offset);
> return -ENODEV;
> }
> pins[pin_index] = pin;
> @@ -461,8 +461,8 @@ static int ti_iodelay_node_iterator(struct pinctrl_dev *pctldev,
> pd = &iod->pa[pin];
> pd->drv_data = &cfg[pin_index];
>
> - dev_dbg(iod->dev, "%s offset=%x a_delay = %d g_delay = %d\n",
> - np->name, cfg[pin_index].offset, cfg[pin_index].a_delay,
> + dev_dbg(iod->dev, "%pOFn offset=%x a_delay = %d g_delay = %d\n",
> + np, cfg[pin_index].offset, cfg[pin_index].a_delay,
> cfg[pin_index].g_delay);
>
> return 0;
> --
> 2.17.1
>

--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

2018-08-28 07:26:31

by Geert Uytterhoeven

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

On Tue, Aug 28, 2018 at 3:54 AM 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: Simon Horman <[email protected]>
> Cc: Magnus Damm <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Reviewed-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2018-08-28 07:56:40

by Andy Shevchenko

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

On Tue, Aug 28, 2018 at 4:56 AM 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.

> + if (snprintf(node_name, sizeof(node_name), "%pOFn", np) != 5)
> return 0;

> + if (strncmp(np, "i2s-", 4))
> return 0;

Shouldn't be node_name here?



--
With Best Regards,
Andy Shevchenko

2018-08-28 07:59:59

by Andy Shevchenko

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

On Tue, Aug 28, 2018 at 4:57 AM 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.

> + snprintf((char *)dai->platform_name, DAI_NAME_SIZE, "%llx.%pOFn",
> + (unsigned long long) res.start, dma_channel_np);

I understand that is not the part of the change, but wouldn't be good
to replace that ugly casting with proper specifier as well?
I mean
%pa ... &res.start

> + dev_err(&pdev->dev, "%pOFn sync own reference\n",
> + np);

One line?

--
With Best Regards,
Andy Shevchenko

2018-08-28 08:03:35

by Adrian Hunter

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

On 28/08/18 04:52, 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: Adrian Hunter <[email protected]>
> Cc: Hu Ziji <[email protected]>
> Cc: Ulf Hansson <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Acked-by: Adrian Hunter <[email protected]>

> ---
> drivers/mmc/host/sdhci-xenon-phy.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c
> index c335052d0c02..5956e90380e8 100644
> --- a/drivers/mmc/host/sdhci-xenon-phy.c
> +++ b/drivers/mmc/host/sdhci-xenon-phy.c
> @@ -660,8 +660,8 @@ static int get_dt_pad_ctrl_data(struct sdhci_host *host,
> return 0;
>
> if (of_address_to_resource(np, 1, &iomem)) {
> - dev_err(mmc_dev(host->mmc), "Unable to find SoC PAD ctrl register address for %s\n",
> - np->name);
> + dev_err(mmc_dev(host->mmc), "Unable to find SoC PAD ctrl register address for %pOFn\n",
> + np);
> return -EINVAL;
> }
>
>


2018-08-28 08:32:35

by Tan, Ley Foon

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

On Mon, 2018-08-27 at 20:52 -0500, 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: Ley Foon Tan <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
Acked-by: Ley Foon Tan <[email protected]>

> ---
> Ā arch/nios2/kernel/time.c | 4 ++--
> Ā 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/nios2/kernel/time.c b/arch/nios2/kernel/time.c
> index ab88b6dd4679..54467d0085a1 100644
> --- a/arch/nios2/kernel/time.c
> +++ b/arch/nios2/kernel/time.c
> @@ -214,12 +214,12 @@ static int __init
> nios2_timer_get_base_and_freq(struct device_node *np,
> Ā {
> Ā Ā Ā Ā Ā Ā Ā Ā *base = of_iomap(np, 0);
> Ā Ā Ā Ā Ā Ā Ā Ā if (!*base) {
> -Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā pr_crit("Unable to map reg for %s\n", np->name);
> +Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā pr_crit("Unable to map reg for %pOFn\n", np);
> Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā return -ENXIO;
> Ā Ā Ā Ā Ā Ā Ā Ā }
>
> Ā Ā Ā Ā Ā Ā Ā Ā if (of_property_read_u32(np, "clock-frequency", freq)) {
> -Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā pr_crit("Unable to get %s clock frequency\n", np-
> >name);
> +Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā pr_crit("Unable to get %pOFn clock frequency\n", np);
> Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā return -EINVAL;
> Ā Ā Ā Ā Ā Ā Ā Ā }
>
> --
> 2.17.1
>
>
> ________________________________
>
> Confidentiality Notice.
> This message may contain information that is confidential or
> otherwise protected from disclosure. If you are not the intended
> recipient, you are hereby notified that any use, disclosure,
> dissemination, distribution, or copying of this message, or any
> attachments, is strictly prohibited. If you have received this
> message in error, please advise the sender by reply e-mail, and
> delete the message and any attachments. Thank you.

2018-08-28 09:18:24

by Boris Brezillon

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

On Mon, 27 Aug 2018 20:52:34 -0500
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: Boris Brezillon <[email protected]>
> Cc: Miquel Raynal <[email protected]>
> Cc: Richard Weinberger <[email protected]>
> Cc: David Woodhouse <[email protected]>
> Cc: Brian Norris <[email protected]>
> Cc: Marek Vasut <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Acked-by: Boris Brezillon <[email protected]>

> ---
> drivers/mtd/nand/raw/fsl_upm.c | 4 ++--
> drivers/mtd/nand/raw/ndfc.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
> index a88e2cf66e0f..ca82727eca94 100644
> --- a/drivers/mtd/nand/raw/fsl_upm.c
> +++ b/drivers/mtd/nand/raw/fsl_upm.c
> @@ -184,8 +184,8 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
> return -ENODEV;
>
> nand_set_flash_node(&fun->chip, flash_np);
> - mtd->name = kasprintf(GFP_KERNEL, "0x%llx.%s", (u64)io_res->start,
> - flash_np->name);
> + mtd->name = kasprintf(GFP_KERNEL, "0x%llx.%pOFn", (u64)io_res->start,
> + flash_np);
> if (!mtd->name) {
> ret = -ENOMEM;
> goto err;
> diff --git a/drivers/mtd/nand/raw/ndfc.c b/drivers/mtd/nand/raw/ndfc.c
> index 540fa1a0ea24..b193f373f235 100644
> --- a/drivers/mtd/nand/raw/ndfc.c
> +++ b/drivers/mtd/nand/raw/ndfc.c
> @@ -174,8 +174,8 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc,
> return -ENODEV;
> nand_set_flash_node(chip, flash_np);
>
> - mtd->name = kasprintf(GFP_KERNEL, "%s.%s", dev_name(&ndfc->ofdev->dev),
> - flash_np->name);
> + mtd->name = kasprintf(GFP_KERNEL, "%s.%pOFn", dev_name(&ndfc->ofdev->dev),
> + flash_np);
> if (!mtd->name) {
> ret = -ENOMEM;
> goto err;


2018-08-28 10:09:05

by Laurent Pinchart

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

Hi Rob,

Thank you for the patch.

On Tuesday, 28 August 2018 04:52:29 EEST 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: Mauro Carvalho Chehab <[email protected]>
> Cc: "Lad, Prabhakar" <[email protected]>
> Cc: Benoit Parrot <[email protected]>
> Cc: Philipp Zabel <[email protected]>
> Cc: Hyun Kwon <[email protected]>
> Cc: Laurent Pinchart <[email protected]>
> Cc: Michal Simek <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Reviewed-by: Laurent Pinchart <[email protected]>

Which tree would you like to merge this through ?

> ---
> drivers/media/i2c/tvp5150.c | 8 ++++----
> drivers/media/platform/davinci/vpif_capture.c | 3 +--
> drivers/media/platform/ti-vpe/cal.c | 8 ++++----
> drivers/media/platform/video-mux.c | 2 +-
> drivers/media/platform/xilinx/xilinx-dma.c | 8 ++++----
> 5 files changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
> index 76e6bed5a1da..f337e523821b 100644
> --- a/drivers/media/i2c/tvp5150.c
> +++ b/drivers/media/i2c/tvp5150.c
> @@ -1403,8 +1403,8 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder,
> struct device_node *np) ret = of_property_read_u32(child, "input",
> &input_type);
> if (ret) {
> dev_err(decoder->sd.dev,
> - "missing type property in node %s\n",
> - child->name);
> + "missing type property in node %pOFn\n",
> + child);
> goto err_connector;
> }
>
> @@ -1439,8 +1439,8 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder,
> struct device_node *np) ret = of_property_read_string(child, "label",
> &name);
> if (ret < 0) {
> dev_err(decoder->sd.dev,
> - "missing label property in node %s\n",
> - child->name);
> + "missing label property in node %pOFn\n",
> + child);
> goto err_connector;
> }
>
> diff --git a/drivers/media/platform/davinci/vpif_capture.c
> b/drivers/media/platform/davinci/vpif_capture.c index
> a96f53ce8088..35fc69591d54 100644
> --- a/drivers/media/platform/davinci/vpif_capture.c
> +++ b/drivers/media/platform/davinci/vpif_capture.c
> @@ -1583,8 +1583,7 @@ vpif_capture_get_pdata(struct platform_device *pdev)
> goto done;
> }
>
> - dev_dbg(&pdev->dev, "Remote device %s, %pOF found\n",
> - rem->name, rem);
> + dev_dbg(&pdev->dev, "Remote device %pOF found\n", rem);
> sdinfo->name = rem->full_name;
>
> pdata->asd[i] = devm_kzalloc(&pdev->dev,
> diff --git a/drivers/media/platform/ti-vpe/cal.c
> b/drivers/media/platform/ti-vpe/cal.c index d1febe5baa6d..77d755020e78
> 100644
> --- a/drivers/media/platform/ti-vpe/cal.c
> +++ b/drivers/media/platform/ti-vpe/cal.c
> @@ -1712,8 +1712,8 @@ static int of_cal_create_instance(struct cal_ctx *ctx,
> int inst) v4l2_fwnode_endpoint_parse(of_fwnode_handle(remote_ep),
> endpoint);
>
> if (endpoint->bus_type != V4L2_MBUS_CSI2) {
> - ctx_err(ctx, "Port:%d sub-device %s is not a CSI2 device\n",
> - inst, sensor_node->name);
> + ctx_err(ctx, "Port:%d sub-device %pOFn is not a CSI2 device\n",
> + inst, sensor_node);
> goto cleanup_exit;
> }
>
> @@ -1732,8 +1732,8 @@ static int of_cal_create_instance(struct cal_ctx *ctx,
> int inst) endpoint->bus.mipi_csi2.data_lanes[lane]);
> ctx_dbg(3, ctx, "\t>\n");
>
> - ctx_dbg(1, ctx, "Port: %d found sub-device %s\n",
> - inst, sensor_node->name);
> + ctx_dbg(1, ctx, "Port: %d found sub-device %pOFn\n",
> + inst, sensor_node);
>
> ctx->asd_list[0] = asd;
> ctx->notifier.subdevs = ctx->asd_list;
> diff --git a/drivers/media/platform/video-mux.c
> b/drivers/media/platform/video-mux.c index c01e1592ad0a..61a9bf716a05
> 100644
> --- a/drivers/media/platform/video-mux.c
> +++ b/drivers/media/platform/video-mux.c
> @@ -333,7 +333,7 @@ static int video_mux_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, vmux);
>
> v4l2_subdev_init(&vmux->subdev, &video_mux_subdev_ops);
> - snprintf(vmux->subdev.name, sizeof(vmux->subdev.name), "%s", np->name);
> + snprintf(vmux->subdev.name, sizeof(vmux->subdev.name), "%pOFn", np);
> vmux->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
> vmux->subdev.dev = dev;
>
> diff --git a/drivers/media/platform/xilinx/xilinx-dma.c
> b/drivers/media/platform/xilinx/xilinx-dma.c index
> d041f94be832..3c8fcf951c63 100644
> --- a/drivers/media/platform/xilinx/xilinx-dma.c
> +++ b/drivers/media/platform/xilinx/xilinx-dma.c
> @@ -506,8 +506,8 @@ xvip_dma_querycap(struct file *file, void *fh, struct
> v4l2_capability *cap)
>
> strlcpy(cap->driver, "xilinx-vipp", sizeof(cap->driver));
> strlcpy(cap->card, dma->video.name, sizeof(cap->card));
> - snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s:%u",
> - dma->xdev->dev->of_node->name, dma->port);
> + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%pOFn:%u",
> + dma->xdev->dev->of_node, dma->port);
>
> return 0;
> }
> @@ -693,8 +693,8 @@ int xvip_dma_init(struct xvip_composite_device *xdev,
> struct xvip_dma *dma, dma->video.fops = &xvip_dma_fops;
> dma->video.v4l2_dev = &xdev->v4l2_dev;
> dma->video.queue = &dma->queue;
> - snprintf(dma->video.name, sizeof(dma->video.name), "%s %s %u",
> - xdev->dev->of_node->name,
> + snprintf(dma->video.name, sizeof(dma->video.name), "%pOFn %s %u",
> + xdev->dev->of_node,
> type == V4L2_BUF_TYPE_VIDEO_CAPTURE ? "output" : "input",
> port);
> dma->video.vfl_type = VFL_TYPE_GRABBER;


--
Regards,

Laurent Pinchart




2018-08-28 10:43:47

by Thierry Reding

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

On Mon, Aug 27, 2018 at 08:52:30PM -0500, 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: Roger Quadros <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: Kukjin Kim <[email protected]>
> Cc: Krzysztof Kozlowski <[email protected]>
> Cc: Thierry Reding <[email protected]>
> Cc: Jonathan Hunter <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/memory/omap-gpmc.c | 18 +++++++-----------
> drivers/memory/samsung/exynos-srom.c | 4 ++--
> drivers/memory/tegra/mc.c | 6 +++---
> drivers/memory/tegra/tegra124-emc.c | 12 ++++++------
> 4 files changed, 18 insertions(+), 22 deletions(-)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (995.00 B)
signature.asc (849.00 B)
Download all attachments

2018-08-28 10:45:35

by Thierry Reding

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

On Mon, Aug 27, 2018 at 08:52:44PM -0500, 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: Qiang Zhao <[email protected]>
> Cc: Li Yang <[email protected]>
> Cc: Andy Gross <[email protected]>
> Cc: David Brown <[email protected]>
> Cc: Heiko Stuebner <[email protected]>
> Cc: Thierry Reding <[email protected]>
> Cc: Jonathan Hunter <[email protected]>
> Cc: Santosh Shilimkar <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/soc/dove/pmu.c | 8 +++---
> drivers/soc/fsl/qe/qe_tdm.c | 4 +--
> drivers/soc/qcom/apr.c | 2 +-
> drivers/soc/rockchip/pm_domains.c | 44 +++++++++++++++----------------
> drivers/soc/tegra/pmc.c | 12 ++++-----
> drivers/soc/ti/knav_dma.c | 8 +++---
> drivers/soc/ti/knav_qmss_queue.c | 8 +++---
> 7 files changed, 43 insertions(+), 43 deletions(-)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (1.16 kB)
signature.asc (849.00 B)
Download all attachments

2018-08-28 11:09:03

by Sakari Ailus

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

On Mon, Aug 27, 2018 at 08:52:26PM -0500, 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: Sakari Ailus <[email protected]>
> Cc: Jacek Anaszewski <[email protected]>
> Cc: Pavel Machek <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Acked-by: Sakari Ailus <[email protected]>

--
Sakari Ailus
e-mail: [email protected]

2018-08-28 11:21:14

by Kalle Valo

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

Rob Herring <[email protected]> writes:

> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
>
> Cc: Kalle Valo <[email protected]>
> Cc: "David S. Miller" <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/net/wireless/ath/ath6kl/init.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

The correct prefix is "ath6kl:" but I can fix that.

--
Kalle Valo

2018-08-28 11:39:24

by Pavel Machek

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

On Mon 2018-08-27 20:52:26, 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: Sakari Ailus <[email protected]>
> Cc: Jacek Anaszewski <[email protected]>

Acked-by: Pavel Machek <[email protected]>


--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Attachments:
(No filename) (465.00 B)
signature.asc (188.00 B)
Digital signature
Download all attachments

2018-08-28 11:43:49

by Ulf Hansson

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

On 28 August 2018 at 03:52, 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: Adrian Hunter <[email protected]>
> Cc: Hu Ziji <[email protected]>
> Cc: Ulf Hansson <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Applied for next, thanks!

Kind regards
Uffe

> ---
> drivers/mmc/host/sdhci-xenon-phy.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c
> index c335052d0c02..5956e90380e8 100644
> --- a/drivers/mmc/host/sdhci-xenon-phy.c
> +++ b/drivers/mmc/host/sdhci-xenon-phy.c
> @@ -660,8 +660,8 @@ static int get_dt_pad_ctrl_data(struct sdhci_host *host,
> return 0;
>
> if (of_address_to_resource(np, 1, &iomem)) {
> - dev_err(mmc_dev(host->mmc), "Unable to find SoC PAD ctrl register address for %s\n",
> - np->name);
> + dev_err(mmc_dev(host->mmc), "Unable to find SoC PAD ctrl register address for %pOFn\n",
> + np);
> return -EINVAL;
> }
>
> --
> 2.17.1
>

2018-08-28 12:24:07

by Rob Herring (Arm)

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

On Tue, Aug 28, 2018 at 5:06 AM Laurent Pinchart
<[email protected]> wrote:
>
> Hi Rob,
>
> Thank you for the patch.
>
> On Tuesday, 28 August 2018 04:52:29 EEST 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: Mauro Carvalho Chehab <[email protected]>
> > Cc: "Lad, Prabhakar" <[email protected]>
> > Cc: Benoit Parrot <[email protected]>
> > Cc: Philipp Zabel <[email protected]>
> > Cc: Hyun Kwon <[email protected]>
> > Cc: Laurent Pinchart <[email protected]>
> > Cc: Michal Simek <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Rob Herring <[email protected]>
>
> Reviewed-by: Laurent Pinchart <[email protected]>
>
> Which tree would you like to merge this through ?

Media tree. There's no dependency.

Rob

2018-08-28 12:59:00

by Maarten Lankhorst

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

Op 28-08-18 om 03:52 schreef Rob Herring:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
>
> Cc: Gustavo Padovan <[email protected]>
> Cc: Maarten Lankhorst <[email protected]>
> Cc: Sean Paul <[email protected]>
> Cc: David Airlie <[email protected]>
> Cc: Rob Clark <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/gpu/drm/drm_modes.c | 4 ++--
> drivers/gpu/drm/msm/hdmi/hdmi.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 02db9ac82d7a..24a750436559 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -716,8 +716,8 @@ int of_get_drm_display_mode(struct device_node *np,
> if (bus_flags)
> drm_bus_flags_from_videomode(&vm, bus_flags);
>
> - pr_debug("%pOF: got %dx%d display mode from %s\n",
> - np, vm.hactive, vm.vactive, np->name);
> + pr_debug("%pOF: got %dx%d display mode\n",
> + np, vm.hactive, vm.vactive);
Aren't you removing it here instead of converting?

~Maarten
> drm_mode_debug_printmodeline(dmode);
>
> return 0;
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index c79659ca5706..23670907a29d 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -579,7 +579,7 @@ static int msm_hdmi_bind(struct device *dev, struct device *master, void *data)
> hdmi_cfg = (struct hdmi_platform_config *)
> of_device_get_match_data(dev);
> if (!hdmi_cfg) {
> - dev_err(dev, "unknown hdmi_cfg: %s\n", of_node->name);
> + dev_err(dev, "unknown hdmi_cfg: %pOFn\n", of_node);
> return -ENXIO;
> }
>



2018-08-28 13:58:23

by Guenter Roeck

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

On 08/27/2018 06:52 PM, 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]>

The devm_kstrdup((..., "iio_hwmon") is getting a bit ridiculous and is asking
for a rewrite, but that can be done in a separate patch.

Other than that, do you want this taken through hwmon or as a series on its own ?

For the latter case,

Acked-by: Guenter Roeck <[email protected]>

otherwise please let me know.

Guenter

> ---
> drivers/hwmon/aspeed-pwm-tacho.c | 2 +-
> drivers/hwmon/ibmpowernv.c | 4 ++--
> drivers/hwmon/iio_hwmon.c | 9 ++++-----
> drivers/hwmon/npcm750-pwm-fan.c | 2 +-
> 4 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c
> index 5e449eac788a..92de8139d398 100644
> --- a/drivers/hwmon/aspeed-pwm-tacho.c
> +++ b/drivers/hwmon/aspeed-pwm-tacho.c
> @@ -852,7 +852,7 @@ static int aspeed_create_pwm_cooling(struct device *dev,
> dev_err(dev, "Property 'cooling-levels' cannot be read.\n");
> return ret;
> }
> - snprintf(cdev->name, MAX_CDEV_NAME_LEN, "%s%d", child->name, pwm_port);
> + snprintf(cdev->name, MAX_CDEV_NAME_LEN, "%pOFn%d", child, pwm_port);
>
> cdev->tcdev = thermal_of_cooling_device_register(child,
> cdev->name,
> diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
> index 83472808c816..4935897f1527 100644
> --- a/drivers/hwmon/ibmpowernv.c
> +++ b/drivers/hwmon/ibmpowernv.c
> @@ -603,8 +603,8 @@ static int create_device_attrs(struct platform_device *pdev)
> if (of_property_read_u32(np, "sensor-id", &sensor_id) &&
> of_property_read_u32(np, "sensor-data", &sensor_id)) {
> dev_info(&pdev->dev,
> - "'sensor-id' missing in the node '%s'\n",
> - np->name);
> + "'sensor-id' missing in the node '%pOFn'\n",
> + np);
> continue;
> }
>
> diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
> index 2f3f875c06ac..7566991f1c04 100644
> --- a/drivers/hwmon/iio_hwmon.c
> +++ b/drivers/hwmon/iio_hwmon.c
> @@ -65,13 +65,9 @@ static int iio_hwmon_probe(struct platform_device *pdev)
> int in_i = 1, temp_i = 1, curr_i = 1, humidity_i = 1;
> enum iio_chan_type type;
> struct iio_channel *channels;
> - const char *name = "iio_hwmon";
> struct device *hwmon_dev;
> char *sname;
>
> - if (dev->of_node && dev->of_node->name)
> - name = dev->of_node->name;
> -
> channels = devm_iio_channel_get_all(dev);
> if (IS_ERR(channels)) {
> if (PTR_ERR(channels) == -ENODEV)
> @@ -141,7 +137,10 @@ static int iio_hwmon_probe(struct platform_device *pdev)
> st->attr_group.attrs = st->attrs;
> st->groups[0] = &st->attr_group;
>
> - sname = devm_kstrdup(dev, name, GFP_KERNEL);
> + if (dev->of_node)
> + sname = devm_kasprintf(dev, GFP_KERNEL, "%pOFn", dev->of_node);
> + else
> + sname = devm_kstrdup(dev, "iio_hwmon", GFP_KERNEL);
> if (!sname)
> return -ENOMEM;
>
> diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c
> index 8474d601aa63..96634fd54e0b 100644
> --- a/drivers/hwmon/npcm750-pwm-fan.c
> +++ b/drivers/hwmon/npcm750-pwm-fan.c
> @@ -861,7 +861,7 @@ static int npcm7xx_create_pwm_cooling(struct device *dev,
> dev_err(dev, "Property 'cooling-levels' cannot be read.\n");
> return ret;
> }
> - snprintf(cdev->name, THERMAL_NAME_LENGTH, "%s%d", child->name,
> + snprintf(cdev->name, THERMAL_NAME_LENGTH, "%pOFn%d", child,
> pwm_port);
>
> cdev->tcdev = thermal_of_cooling_device_register(child,
>


2018-08-28 14:15:45

by Rob Herring (Arm)

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

On Mon, Aug 27, 2018 at 8:52 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: "David S. Miller" <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---

> @@ -201,7 +201,7 @@ char * __init build_path_component(struct device_node *dp)
> tmp_buf[0] = '\0';
> __build_path_component(dp, tmp_buf);
> if (tmp_buf[0] == '\0')
> - strcpy(tmp_buf, dp->name);
> + snprint(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);

Ugg, v2 coming soon.

Rob

2018-08-28 14:45:32

by Jens Axboe

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

On 8/27/18 7:52 PM, Rob Herring wrote:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.

Applied for 4.20, thanks.

--
Jens Axboe


2018-08-28 15:06:11

by Rob Herring (Arm)

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

On Tue, Aug 28, 2018 at 7:54 AM Maarten Lankhorst
<[email protected]> wrote:
>
> Op 28-08-18 om 03:52 schreef Rob Herring:
> > In preparation to remove the node name pointer from struct device_node,
> > convert printf users to use the %pOFn format specifier.
> >
> > Cc: Gustavo Padovan <[email protected]>
> > Cc: Maarten Lankhorst <[email protected]>
> > Cc: Sean Paul <[email protected]>
> > Cc: David Airlie <[email protected]>
> > Cc: Rob Clark <[email protected]>
> > Cc: [email protected]
> > Cc: [email protected]
> > Cc: [email protected]
> > Signed-off-by: Rob Herring <[email protected]>
> > ---
> > drivers/gpu/drm/drm_modes.c | 4 ++--
> > drivers/gpu/drm/msm/hdmi/hdmi.c | 2 +-
> > 2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> > index 02db9ac82d7a..24a750436559 100644
> > --- a/drivers/gpu/drm/drm_modes.c
> > +++ b/drivers/gpu/drm/drm_modes.c
> > @@ -716,8 +716,8 @@ int of_get_drm_display_mode(struct device_node *np,
> > if (bus_flags)
> > drm_bus_flags_from_videomode(&vm, bus_flags);
> >
> > - pr_debug("%pOF: got %dx%d display mode from %s\n",
> > - np, vm.hactive, vm.vactive, np->name);
> > + pr_debug("%pOF: got %dx%d display mode\n",
> > + np, vm.hactive, vm.vactive);
> Aren't you removing it here instead of converting?

Well, yes. The full path and name are already printed so the node name
alone was pretty redundant.

Rob

2018-08-28 15:06:15

by Rob Clark

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

On Mon, Aug 27, 2018 at 9:53 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: Gustavo Padovan <[email protected]>
> Cc: Maarten Lankhorst <[email protected]>
> Cc: Sean Paul <[email protected]>
> Cc: David Airlie <[email protected]>
> Cc: Rob Clark <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

for msm part,

Acked-by: Rob Clark <[email protected]>

(for drm_modes part, I guess there is no harm removing the redundant name)

BR,
-R

> ---
> drivers/gpu/drm/drm_modes.c | 4 ++--
> drivers/gpu/drm/msm/hdmi/hdmi.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 02db9ac82d7a..24a750436559 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -716,8 +716,8 @@ int of_get_drm_display_mode(struct device_node *np,
> if (bus_flags)
> drm_bus_flags_from_videomode(&vm, bus_flags);
>
> - pr_debug("%pOF: got %dx%d display mode from %s\n",
> - np, vm.hactive, vm.vactive, np->name);
> + pr_debug("%pOF: got %dx%d display mode\n",
> + np, vm.hactive, vm.vactive);
> drm_mode_debug_printmodeline(dmode);
>
> return 0;
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index c79659ca5706..23670907a29d 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -579,7 +579,7 @@ static int msm_hdmi_bind(struct device *dev, struct device *master, void *data)
> hdmi_cfg = (struct hdmi_platform_config *)
> of_device_get_match_data(dev);
> if (!hdmi_cfg) {
> - dev_err(dev, "unknown hdmi_cfg: %s\n", of_node->name);
> + dev_err(dev, "unknown hdmi_cfg: %pOFn\n", of_node);
> return -ENXIO;
> }
>
> --
> 2.17.1
>

2018-08-28 15:13:29

by Rob Herring (Arm)

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

On Tue, Aug 28, 2018 at 8:57 AM Guenter Roeck <[email protected]> wrote:
>
> On 08/27/2018 06:52 PM, 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]>
>
> The devm_kstrdup((..., "iio_hwmon") is getting a bit ridiculous and is asking
> for a rewrite, but that can be done in a separate patch.

Yeah, I tend to think the drivers should just set a name rather than
pass thru whatever is in DT. If the DT follows good practice then the
node name is just going to reflect the generic class of device.

> Other than that, do you want this taken through hwmon or as a series on its own ?

You can take it.

Rob

2018-08-28 15:34:48

by Tony Lindgren

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

* Rob Herring <[email protected]> [180828 01:58]:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
...
> drivers/memory/omap-gpmc.c | 18 +++++++-----------

Looks good to me:

Acked-by: Tony Lindgren <[email protected]>

2018-08-28 15:36:04

by Tony Lindgren

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

* Rob Herring <[email protected]> [180828 01:59]:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
...
> drivers/pinctrl/pinctrl-single.c | 32 +++++++++----------
> drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 8 ++---

Acked-by: Tony Lindgren <[email protected]>

2018-08-28 15:46:11

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH v2] ARM: omap: 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: "BenoĆ®t Cousson" <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
v2:
- fix error in format specifier position

arch/arm/mach-omap2/omap_hwmod.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 2ceffd85dd3d..9cc339048173 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -738,7 +738,7 @@ static int __init _setup_clkctrl_provider(struct device_node *np)
provider->size = size | 0xff;
provider->node = np;

- pr_debug("%s: %s: %x...%x [+%x]\n", __func__, np->parent->name,
+ pr_debug("%s: %pOFn: %x...%x [+%x]\n", __func__, np->parent,
provider->addr, provider->addr + provider->size,
provider->offset);

@@ -799,9 +799,9 @@ static struct clk *_lookup_clkctrl_clk(struct omap_hwmod *oh)

clk = of_clk_get_from_provider(&clkspec);

- pr_debug("%s: %s got %p (offset=%x, provider=%s)\n",
+ pr_debug("%s: %s got %p (offset=%x, provider=%pOFn)\n",
__func__, oh->name, clk, clkspec.args[0],
- provider->node->parent->name);
+ provider->node->parent);

return clk;
}
@@ -2107,8 +2107,8 @@ static int of_dev_find_hwmod(struct device_node *np,
if (res)
continue;
if (!strcmp(p, oh->name)) {
- pr_debug("omap_hwmod: dt %s[%i] uses hwmod %s\n",
- np->name, i, oh->name);
+ pr_debug("omap_hwmod: dt %pOFn[%i] uses hwmod %s\n",
+ np, i, oh->name);
return i;
}
}
@@ -2210,8 +2210,8 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
return -ENOENT;

if (nr_addr != 1 || nr_size != 1) {
- pr_err("%s: invalid range for %s->%s\n", __func__,
- oh->name, np->name);
+ pr_err("%s: invalid range for %s->%pOFn\n", __func__,
+ oh->name, np);
return -EINVAL;
}

@@ -2219,8 +2219,8 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
base = of_translate_address(np, ranges++);
size = be32_to_cpup(ranges);

- pr_debug("omap_hwmod: %s %s at 0x%llx size 0x%llx\n",
- oh->name, np->name, base, size);
+ pr_debug("omap_hwmod: %s %pOFn at 0x%llx size 0x%llx\n",
+ oh->name, np, base, size);

res->start = base;
res->end = base + size - 1;
@@ -2322,8 +2322,8 @@ static int __init _init(struct omap_hwmod *oh, void *data)
if (r)
pr_debug("omap_hwmod: %s missing dt data\n", oh->name);
else if (np && index)
- pr_warn("omap_hwmod: %s using broken dt data from %s\n",
- oh->name, np->name);
+ pr_warn("omap_hwmod: %s using broken dt data from %pOFn\n",
+ oh->name, np);

r = _init_mpu_rt_base(oh, NULL, index, np);
if (r < 0) {
--
2.17.1

2018-08-28 15:46:17

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH v2] staging: 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: Steve Longerbeam <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
v2:
- fix conditional use of node name vs devname for imx

drivers/staging/media/imx/imx-media-dev.c | 15 ++++++++++-----
drivers/staging/media/imx/imx-media-of.c | 4 ++--
drivers/staging/mt7621-eth/mdio.c | 4 ++--
3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c
index b0be80f05767..3f48f5ceb6ea 100644
--- a/drivers/staging/media/imx/imx-media-dev.c
+++ b/drivers/staging/media/imx/imx-media-dev.c
@@ -89,8 +89,12 @@ int imx_media_add_async_subdev(struct imx_media_dev *imxmd,

/* return -EEXIST if this asd already added */
if (find_async_subdev(imxmd, fwnode, devname)) {
- dev_dbg(imxmd->md.dev, "%s: already added %s\n",
- __func__, np ? np->name : devname);
+ if (np)
+ dev_dbg(imxmd->md.dev, "%s: already added %pOFn\n",
+ __func__, np);
+ else
+ dev_dbg(imxmd->md.dev, "%s: already added %s\n",
+ __func__, devname);
ret = -EEXIST;
goto out;
}
@@ -105,19 +109,20 @@ int imx_media_add_async_subdev(struct imx_media_dev *imxmd,
if (fwnode) {
asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
asd->match.fwnode = fwnode;
+ dev_dbg(imxmd->md.dev, "%s: added %pOFn, match type FWNODE\n",
+ __func__, np);
} else {
asd->match_type = V4L2_ASYNC_MATCH_DEVNAME;
asd->match.device_name = devname;
imxasd->pdev = pdev;
+ dev_dbg(imxmd->md.dev, "%s: added %s, match type DEVNAME\n",
+ __func__, devname);
}

list_add_tail(&imxasd->list, &imxmd->asd_list);

imxmd->subdev_notifier.num_subdevs++;

- dev_dbg(imxmd->md.dev, "%s: added %s, match type %s\n",
- __func__, np ? np->name : devname, np ? "FWNODE" : "DEVNAME");
-
out:
mutex_unlock(&imxmd->mutex);
return ret;
diff --git a/drivers/staging/media/imx/imx-media-of.c b/drivers/staging/media/imx/imx-media-of.c
index acde372c6795..163437e421c5 100644
--- a/drivers/staging/media/imx/imx-media-of.c
+++ b/drivers/staging/media/imx/imx-media-of.c
@@ -79,8 +79,8 @@ of_parse_subdev(struct imx_media_dev *imxmd, struct device_node *sd_np,
int i, num_ports, ret;

if (!of_device_is_available(sd_np)) {
- dev_dbg(imxmd->md.dev, "%s: %s not enabled\n", __func__,
- sd_np->name);
+ dev_dbg(imxmd->md.dev, "%s: %pOFn not enabled\n", __func__,
+ sd_np);
/* unavailable is not an error */
return 0;
}
diff --git a/drivers/staging/mt7621-eth/mdio.c b/drivers/staging/mt7621-eth/mdio.c
index 7ad0c4141205..9ffa8f771235 100644
--- a/drivers/staging/mt7621-eth/mdio.c
+++ b/drivers/staging/mt7621-eth/mdio.c
@@ -70,7 +70,7 @@ int mtk_connect_phy_node(struct mtk_eth *eth, struct mtk_mac *mac,
_port = of_get_property(phy_node, "reg", NULL);

if (!_port || (be32_to_cpu(*_port) >= 0x20)) {
- pr_err("%s: invalid port id\n", phy_node->name);
+ pr_err("%pOFn: invalid port id\n", phy_node);
return -EINVAL;
}
port = be32_to_cpu(*_port);
@@ -249,7 +249,7 @@ int mtk_mdio_init(struct mtk_eth *eth)
eth->mii_bus->priv = eth;
eth->mii_bus->parent = eth->dev;

- snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%s", mii_np->name);
+ snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%pOFn", mii_np);
err = of_mdiobus_register(eth->mii_bus, mii_np);
if (err)
goto err_free_bus;
--
2.17.1

2018-08-28 15:46:32

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH v2] sparc: 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: "David S. Miller" <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
v2:
- snprint -> snprintf typo fix

arch/sparc/kernel/auxio_64.c | 4 +--
arch/sparc/kernel/power.c | 4 +--
arch/sparc/kernel/prom_32.c | 26 +++++++-------
arch/sparc/kernel/prom_64.c | 68 ++++++++++++++++++------------------
4 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c
index 4e8f56c3793c..cc42225c20f3 100644
--- a/arch/sparc/kernel/auxio_64.c
+++ b/arch/sparc/kernel/auxio_64.c
@@ -115,8 +115,8 @@ static int auxio_probe(struct platform_device *dev)
auxio_devtype = AUXIO_TYPE_SBUS;
size = 1;
} else {
- printk("auxio: Unknown parent bus type [%s]\n",
- dp->parent->name);
+ printk("auxio: Unknown parent bus type [%pOFn]\n",
+ dp->parent);
return -ENODEV;
}
auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio");
diff --git a/arch/sparc/kernel/power.c b/arch/sparc/kernel/power.c
index 92627abce311..d941875dd718 100644
--- a/arch/sparc/kernel/power.c
+++ b/arch/sparc/kernel/power.c
@@ -41,8 +41,8 @@ static int power_probe(struct platform_device *op)

power_reg = of_ioremap(res, 0, 0x4, "power");

- printk(KERN_INFO "%s: Control reg at %llx\n",
- op->dev.of_node->name, res->start);
+ printk(KERN_INFO "%pOFn: Control reg at %llx\n",
+ op->dev.of_node, res->start);

if (has_button_interrupt(irq, op->dev.of_node)) {
if (request_irq(irq,
diff --git a/arch/sparc/kernel/prom_32.c b/arch/sparc/kernel/prom_32.c
index b51cbb9e87dc..17c87d29ff20 100644
--- a/arch/sparc/kernel/prom_32.c
+++ b/arch/sparc/kernel/prom_32.c
@@ -68,8 +68,8 @@ static void __init sparc32_path_component(struct device_node *dp, char *tmp_buf)
return;

regs = rprop->value;
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
regs->which_io, regs->phys_addr);
}

@@ -84,8 +84,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
return;

regs = prop->value;
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
regs->which_io,
regs->phys_addr);
}
@@ -104,13 +104,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value;
devfn = (regs->phys_hi >> 8) & 0xff;
if (devfn & 0x07) {
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
devfn >> 3,
devfn & 0x07);
} else {
- sprintf(tmp_buf, "%s@%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x",
+ dp,
devfn >> 3);
}
}
@@ -127,8 +127,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)

regs = prop->value;

- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
regs->which_io, regs->phys_addr);
}

@@ -167,8 +167,8 @@ static void __init ambapp_path_component(struct device_node *dp, char *tmp_buf)
return;
device = prop->value;

- sprintf(tmp_buf, "%s:%d:%d@%x,%x",
- dp->name, *vendor, *device,
+ sprintf(tmp_buf, "%pOFn:%d:%d@%x,%x",
+ dp, *vendor, *device,
*intr, reg0);
}

@@ -201,7 +201,7 @@ char * __init build_path_component(struct device_node *dp)
tmp_buf[0] = '\0';
__build_path_component(dp, tmp_buf);
if (tmp_buf[0] == '\0')
- strcpy(tmp_buf, dp->name);
+ snprintf(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);

n = prom_early_alloc(strlen(tmp_buf) + 1);
strcpy(n, tmp_buf);
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c
index baeaeed64993..6220411ce8fc 100644
--- a/arch/sparc/kernel/prom_64.c
+++ b/arch/sparc/kernel/prom_64.c
@@ -82,8 +82,8 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)

regs = rprop->value;
if (!of_node_is_root(dp->parent)) {
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
(unsigned int) (regs->phys_addr >> 32UL),
(unsigned int) (regs->phys_addr & 0xffffffffUL));
return;
@@ -97,17 +97,17 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
const char *prefix = (type == 0) ? "m" : "i";

if (low_bits)
- sprintf(tmp_buf, "%s@%s%x,%x",
- dp->name, prefix,
+ sprintf(tmp_buf, "%pOFn@%s%x,%x",
+ dp, prefix,
high_bits, low_bits);
else
- sprintf(tmp_buf, "%s@%s%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%s%x",
+ dp,
prefix,
high_bits);
} else if (type == 12) {
- sprintf(tmp_buf, "%s@%x",
- dp->name, high_bits);
+ sprintf(tmp_buf, "%pOFn@%x",
+ dp, high_bits);
}
}

@@ -122,8 +122,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)

regs = prop->value;
if (!of_node_is_root(dp->parent)) {
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
(unsigned int) (regs->phys_addr >> 32UL),
(unsigned int) (regs->phys_addr & 0xffffffffUL));
return;
@@ -138,8 +138,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
if (tlb_type >= cheetah)
mask = 0x7fffff;

- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
*(u32 *)prop->value,
(unsigned int) (regs->phys_addr & mask));
}
@@ -156,8 +156,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
return;

regs = prop->value;
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
regs->which_io,
regs->phys_addr);
}
@@ -176,13 +176,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value;
devfn = (regs->phys_hi >> 8) & 0xff;
if (devfn & 0x07) {
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
devfn >> 3,
devfn & 0x07);
} else {
- sprintf(tmp_buf, "%s@%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x",
+ dp,
devfn >> 3);
}
}
@@ -203,8 +203,8 @@ static void __init upa_path_component(struct device_node *dp, char *tmp_buf)
if (!prop)
return;

- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
*(u32 *) prop->value,
(unsigned int) (regs->phys_addr & 0xffffffffUL));
}
@@ -221,7 +221,7 @@ static void __init vdev_path_component(struct device_node *dp, char *tmp_buf)

regs = prop->value;

- sprintf(tmp_buf, "%s@%x", dp->name, *regs);
+ sprintf(tmp_buf, "%pOFn@%x", dp, *regs);
}

/* "name@addrhi,addrlo" */
@@ -236,8 +236,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)

regs = prop->value;

- sprintf(tmp_buf, "%s@%x,%x",
- dp->name,
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp,
(unsigned int) (regs->phys_addr >> 32UL),
(unsigned int) (regs->phys_addr & 0xffffffffUL));
}
@@ -257,8 +257,8 @@ static void __init i2c_path_component(struct device_node *dp, char *tmp_buf)
/* This actually isn't right... should look at the #address-cells
* property of the i2c bus node etc. etc.
*/
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name, regs[0], regs[1]);
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp, regs[0], regs[1]);
}

/* "name@reg0[,reg1]" */
@@ -274,11 +274,11 @@ static void __init usb_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value;

if (prop->length == sizeof(u32) || regs[1] == 1) {
- sprintf(tmp_buf, "%s@%x",
- dp->name, regs[0]);
+ sprintf(tmp_buf, "%pOFn@%x",
+ dp, regs[0]);
} else {
- sprintf(tmp_buf, "%s@%x,%x",
- dp->name, regs[0], regs[1]);
+ sprintf(tmp_buf, "%pOFn@%x,%x",
+ dp, regs[0], regs[1]);
}
}

@@ -295,11 +295,11 @@ static void __init ieee1394_path_component(struct device_node *dp, char *tmp_buf
regs = prop->value;

if (regs[2] || regs[3]) {
- sprintf(tmp_buf, "%s@%08x%08x,%04x%08x",
- dp->name, regs[0], regs[1], regs[2], regs[3]);
+ sprintf(tmp_buf, "%pOFn@%08x%08x,%04x%08x",
+ dp, regs[0], regs[1], regs[2], regs[3]);
} else {
- sprintf(tmp_buf, "%s@%08x%08x",
- dp->name, regs[0], regs[1]);
+ sprintf(tmp_buf, "%pOFn@%08x%08x",
+ dp, regs[0], regs[1]);
}
}

@@ -361,7 +361,7 @@ char * __init build_path_component(struct device_node *dp)
tmp_buf[0] = '\0';
__build_path_component(dp, tmp_buf);
if (tmp_buf[0] == '\0')
- strcpy(tmp_buf, dp->name);
+ snprintf(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);

n = prom_early_alloc(strlen(tmp_buf) + 1);
strcpy(n, tmp_buf);
--
2.17.1

2018-08-28 15:46:38

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH v2] net: ethernet: 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: "David S. Miller" <[email protected]>
Cc: Yisen Zhuang <[email protected]>
Cc: Salil Mehta <[email protected]>
Cc: Sebastian Hesselbarth <[email protected]>
Cc: Felix Fietkau <[email protected]>
Cc: John Crispin <[email protected]>
Cc: Sean Wang <[email protected]>
Cc: Nelson Chang <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: Wingman Kwok <[email protected]>
Cc: Murali Karicheri <[email protected]>
Cc: [email protected]

Signed-off-by: Rob Herring <[email protected]>
---
v2:
- fix missing brackets in netcp

drivers/net/ethernet/freescale/fsl_pq_mdio.c | 4 +-
.../net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 8 ++--
drivers/net/ethernet/marvell/mv643xx_eth.c | 6 +--
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
drivers/net/ethernet/sun/sunhme.c | 2 +-
drivers/net/ethernet/ti/netcp_core.c | 22 ++++------
drivers/net/ethernet/ti/netcp_ethss.c | 42 +++++++++----------
7 files changed, 40 insertions(+), 46 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
index ac2c3f6a12bc..82722d05fedb 100644
--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
+++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
@@ -446,8 +446,8 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev)
goto error;
}

- snprintf(new_bus->id, MII_BUS_ID_SIZE, "%s@%llx", np->name,
- (unsigned long long)res.start);
+ snprintf(new_bus->id, MII_BUS_ID_SIZE, "%pOFn@%llx", np,
+ (unsigned long long)res.start);

priv->map = of_iomap(np, 0);
if (!priv->map) {
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index 1c2326bd76e2..6521d8d53745 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -807,8 +807,8 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
*/
put_device(&mac_cb->phy_dev->mdio.dev);

- dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
- mac_cb->mac_id, np->name);
+ dev_dbg(mac_cb->dev, "mac%d phy_node: %pOFn\n",
+ mac_cb->mac_id, np);
}
of_node_put(np);

@@ -825,8 +825,8 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
* if the phy_dev is found
*/
put_device(&mac_cb->phy_dev->mdio.dev);
- dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
- mac_cb->mac_id, np->name);
+ dev_dbg(mac_cb->dev, "mac%d phy_node: %pOFn\n",
+ mac_cb->mac_id, np);
}
of_node_put(np);

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 62f204f32316..1e9bcbdc6a90 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2733,17 +2733,17 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,

memset(&res, 0, sizeof(res));
if (of_irq_to_resource(pnp, 0, &res) <= 0) {
- dev_err(&pdev->dev, "missing interrupt on %s\n", pnp->name);
+ dev_err(&pdev->dev, "missing interrupt on %pOFn\n", pnp);
return -EINVAL;
}

if (of_property_read_u32(pnp, "reg", &ppd.port_number)) {
- dev_err(&pdev->dev, "missing reg property on %s\n", pnp->name);
+ dev_err(&pdev->dev, "missing reg property on %pOFn\n", pnp);
return -EINVAL;
}

if (ppd.port_number >= 3) {
- dev_err(&pdev->dev, "invalid reg property on %s\n", pnp->name);
+ dev_err(&pdev->dev, "invalid reg property on %pOFn\n", pnp);
return -EINVAL;
}

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 6e6abdc399de..b44bcfd85b05 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -405,7 +405,7 @@ static int mtk_mdio_init(struct mtk_eth *eth)
eth->mii_bus->priv = eth;
eth->mii_bus->parent = eth->dev;

- snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%s", mii_np->name);
+ snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%pOFn", mii_np);
ret = of_mdiobus_register(eth->mii_bus, mii_np);

err_put_node:
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index 06da2f59fcbf..863fd602fd33 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -2999,7 +2999,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
/* Now make sure pci_dev cookie is there. */
#ifdef CONFIG_SPARC
dp = pci_device_to_OF_node(pdev);
- strcpy(prom_name, dp->name);
+ snprintf(prom_name, sizeof(prom_name), "%pOFn", dp);
#else
if (is_quattro_p(pdev))
strcpy(prom_name, "SUNW,qfe");
diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
index a1d335a3c5e4..1f612268c998 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -225,17 +225,6 @@ static int emac_arch_get_mac_addr(char *x, void __iomem *efuse_mac, u32 swap)
return 0;
}

-static const char *netcp_node_name(struct device_node *node)
-{
- const char *name;
-
- if (of_property_read_string(node, "label", &name) < 0)
- name = node->name;
- if (!name)
- name = "unknown";
- return name;
-}
-
/* Module management routines */
static int netcp_register_interface(struct netcp_intf *netcp)
{
@@ -267,8 +256,13 @@ static int netcp_module_probe(struct netcp_device *netcp_device,
}

for_each_available_child_of_node(devices, child) {
- const char *name = netcp_node_name(child);
+ const char *name;
+ char node_name[32];

+ if (of_property_read_string(node, "label", &name) < 0) {
+ snprintf(node_name, sizeof(node_name), "%pOFn", child);
+ name = node_name;
+ }
if (!strcasecmp(module->name, name))
break;
}
@@ -2209,8 +2203,8 @@ static int netcp_probe(struct platform_device *pdev)
for_each_available_child_of_node(interfaces, child) {
ret = netcp_create_interface(netcp_device, child);
if (ret) {
- dev_err(dev, "could not create interface(%s)\n",
- child->name);
+ dev_err(dev, "could not create interface(%pOFn)\n",
+ child);
goto probe_quit_interface;
}
}
diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index 72b98e27c992..0397ccb6597e 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -3137,15 +3137,15 @@ static void init_secondary_ports(struct gbe_priv *gbe_dev,
for_each_child_of_node(node, port) {
slave = devm_kzalloc(dev, sizeof(*slave), GFP_KERNEL);
if (!slave) {
- dev_err(dev, "memory alloc failed for secondary port(%s), skipping...\n",
- port->name);
+ dev_err(dev, "memory alloc failed for secondary port(%pOFn), skipping...\n",
+ port);
continue;
}

if (init_slave(gbe_dev, slave, port)) {
dev_err(dev,
- "Failed to initialize secondary port(%s), skipping...\n",
- port->name);
+ "Failed to initialize secondary port(%pOFn), skipping...\n",
+ port);
devm_kfree(dev, slave);
continue;
}
@@ -3239,8 +3239,8 @@ static int set_xgbe_ethss10_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, XGBE_SS_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't xlate xgbe of node(%s) ss address at %d\n",
- node->name, XGBE_SS_REG_INDEX);
+ "Can't xlate xgbe of node(%pOFn) ss address at %d\n",
+ node, XGBE_SS_REG_INDEX);
return ret;
}

@@ -3254,8 +3254,8 @@ static int set_xgbe_ethss10_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, XGBE_SM_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't xlate xgbe of node(%s) sm address at %d\n",
- node->name, XGBE_SM_REG_INDEX);
+ "Can't xlate xgbe of node(%pOFn) sm address at %d\n",
+ node, XGBE_SM_REG_INDEX);
return ret;
}

@@ -3269,8 +3269,8 @@ static int set_xgbe_ethss10_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, XGBE_SERDES_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't xlate xgbe serdes of node(%s) address at %d\n",
- node->name, XGBE_SERDES_REG_INDEX);
+ "Can't xlate xgbe serdes of node(%pOFn) address at %d\n",
+ node, XGBE_SERDES_REG_INDEX);
return ret;
}

@@ -3347,8 +3347,8 @@ static int get_gbe_resource_version(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, GBE_SS_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't translate of node(%s) of gbe ss address at %d\n",
- node->name, GBE_SS_REG_INDEX);
+ "Can't translate of node(%pOFn) of gbe ss address at %d\n",
+ node, GBE_SS_REG_INDEX);
return ret;
}

@@ -3372,8 +3372,8 @@ static int set_gbe_ethss14_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, GBE_SGMII34_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't translate of gbe node(%s) address at index %d\n",
- node->name, GBE_SGMII34_REG_INDEX);
+ "Can't translate of gbe node(%pOFn) address at index %d\n",
+ node, GBE_SGMII34_REG_INDEX);
return ret;
}

@@ -3388,8 +3388,8 @@ static int set_gbe_ethss14_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, GBE_SM_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't translate of gbe node(%s) address at index %d\n",
- node->name, GBE_SM_REG_INDEX);
+ "Can't translate of gbe node(%pOFn) address at index %d\n",
+ node, GBE_SM_REG_INDEX);
return ret;
}

@@ -3498,8 +3498,8 @@ static int set_gbenu_ethss_priv(struct gbe_priv *gbe_dev,
ret = of_address_to_resource(node, GBENU_SM_REG_INDEX, &res);
if (ret) {
dev_err(gbe_dev->dev,
- "Can't translate of gbenu node(%s) addr at index %d\n",
- node->name, GBENU_SM_REG_INDEX);
+ "Can't translate of gbenu node(%pOFn) addr at index %d\n",
+ node, GBENU_SM_REG_INDEX);
return ret;
}

@@ -3642,7 +3642,7 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
ret = netcp_xgbe_serdes_init(gbe_dev->xgbe_serdes_regs,
gbe_dev->ss_regs);
} else {
- dev_err(dev, "unknown GBE node(%s)\n", node->name);
+ dev_err(dev, "unknown GBE node(%pOFn)\n", node);
ret = -ENODEV;
}

@@ -3667,8 +3667,8 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
for_each_child_of_node(interfaces, interface) {
ret = of_property_read_u32(interface, "slave-port", &slave_num);
if (ret) {
- dev_err(dev, "missing slave-port parameter, skipping interface configuration for %s\n",
- interface->name);
+ dev_err(dev, "missing slave-port parameter, skipping interface configuration for %pOFn\n",
+ interface);
continue;
}
gbe_dev->num_slaves++;
--
2.17.1

2018-08-28 15:46:44

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH v2] sound: 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: Johannes Berg <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
v2:
- Fix error in strncmp

sound/aoa/soundbus/i2sbus/core.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c
index 000b58522106..bd7c5029fc59 100644
--- a/sound/aoa/soundbus/i2sbus/core.c
+++ b/sound/aoa/soundbus/i2sbus/core.c
@@ -157,18 +157,19 @@ static int i2sbus_add_dev(struct macio_dev *macio,
struct device_node *child = NULL, *sound = NULL;
struct resource *r;
int i, layout = 0, rlen, ok = force;
- static const char *rnames[] = { "i2sbus: %s (control)",
- "i2sbus: %s (tx)",
- "i2sbus: %s (rx)" };
+ char node_name[6];
+ static const char *rnames[] = { "i2sbus: %pOFn (control)",
+ "i2sbus: %pOFn (tx)",
+ "i2sbus: %pOFn (rx)" };
static irq_handler_t ints[] = {
i2sbus_bus_intr,
i2sbus_tx_intr,
i2sbus_rx_intr
};

- if (strlen(np->name) != 5)
+ if (snprintf(node_name, sizeof(node_name), "%pOFn", np) != 5)
return 0;
- if (strncmp(np->name, "i2s-", 4))
+ if (strncmp(node_name, "i2s-", 4))
return 0;

dev = kzalloc(sizeof(struct i2sbus_dev), GFP_KERNEL);
@@ -228,13 +229,13 @@ static int i2sbus_add_dev(struct macio_dev *macio,
dev->sound.pcmid = -1;
dev->macio = macio;
dev->control = control;
- dev->bus_number = np->name[4] - 'a';
+ dev->bus_number = node_name[4] - 'a';
INIT_LIST_HEAD(&dev->sound.codec_list);

for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
dev->interrupts[i] = -1;
snprintf(dev->rnames[i], sizeof(dev->rnames[i]),
- rnames[i], np->name);
+ rnames[i], np);
}
for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
int irq = irq_of_parse_and_map(np, i);
--
2.17.1

2018-08-28 15:46:53

by Max Filippov

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

On Mon, Aug 27, 2018 at 6:52 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: Chris Zankel <[email protected]>
> Cc: Max Filippov <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> arch/xtensa/platforms/xtfpga/setup.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)

Acked-by: Max Filippov <[email protected]>

--
Thanks.
-- Max

2018-08-28 15:46:55

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH v2] clk: 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: Eugeniy Paltsev <[email protected]>
Cc: Michael Turquette <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
v2:
- fix warning in clk/ti/composite.c

drivers/clk/axs10x/pll_clock.c | 4 ++--
drivers/clk/bcm/clk-kona-setup.c | 22 +++++++++++-----------
drivers/clk/clk-asm9260.c | 4 ++--
drivers/clk/clk-cdce925.c | 10 +++++-----
drivers/clk/clk-fixed-factor.c | 8 ++++----
drivers/clk/clk-gpio.c | 8 ++++----
drivers/clk/clk-hsdk-pll.c | 4 ++--
drivers/clk/clk-nomadik.c | 4 ++--
drivers/clk/clk-npcm7xx.c | 2 +-
drivers/clk/clk-palmas.c | 4 ++--
drivers/clk/clk-qoriq.c | 14 +++++++-------
drivers/clk/clk-scmi.c | 2 +-
drivers/clk/clk-scpi.c | 6 +++---
drivers/clk/clk-si5351.c | 4 ++--
drivers/clk/clk-stm32f4.c | 2 +-
drivers/clk/clk-stm32h7.c | 2 +-
drivers/clk/clk-stm32mp1.c | 2 +-
drivers/clk/clk-tango4.c | 10 +++++-----
drivers/clk/keystone/gate.c | 2 +-
drivers/clk/keystone/pll.c | 2 +-
drivers/clk/renesas/clk-div6.c | 12 ++++++------
drivers/clk/renesas/clk-emev2.c | 8 ++++----
drivers/clk/renesas/clk-mstp.c | 8 ++++----
drivers/clk/renesas/clk-r8a73a4.c | 4 ++--
drivers/clk/renesas/clk-r8a7740.c | 4 ++--
drivers/clk/renesas/clk-r8a7778.c | 4 ++--
drivers/clk/renesas/clk-r8a7779.c | 4 ++--
drivers/clk/renesas/clk-rcar-gen2.c | 4 ++--
drivers/clk/renesas/clk-rz.c | 4 ++--
drivers/clk/renesas/clk-sh73a0.c | 4 ++--
drivers/clk/st/clkgen-fsyn.c | 2 +-
drivers/clk/sunxi/clk-mod0.c | 6 +++---
drivers/clk/sunxi/clk-sun9i-core.c | 20 ++++++++++----------
drivers/clk/sunxi/clk-sunxi.c | 4 ++--
drivers/clk/ti/apll.c | 18 +++++++++---------
drivers/clk/ti/clk-dra7-atl.c | 4 ++--
drivers/clk/ti/clk.c | 10 +++++-----
drivers/clk/ti/clkctrl.c | 14 ++++++--------
drivers/clk/ti/composite.c | 14 +++++++-------
drivers/clk/ti/divider.c | 4 ++--
drivers/clk/ti/dpll.c | 12 ++++++------
drivers/clk/ti/fapll.c | 8 ++++----
drivers/clk/ti/fixed-factor.c | 4 ++--
drivers/clk/ti/gate.c | 2 +-
drivers/clk/ti/interface.c | 2 +-
drivers/clk/ti/mux.c | 4 ++--
drivers/clk/zynq/clkc.c | 4 ++--
47 files changed, 151 insertions(+), 153 deletions(-)

diff --git a/drivers/clk/axs10x/pll_clock.c b/drivers/clk/axs10x/pll_clock.c
index 25d8c240ddfb..c68dada97316 100644
--- a/drivers/clk/axs10x/pll_clock.c
+++ b/drivers/clk/axs10x/pll_clock.c
@@ -301,13 +301,13 @@ static void __init of_axs10x_pll_clk_setup(struct device_node *node)

ret = clk_hw_register(NULL, &pll_clk->hw);
if (ret) {
- pr_err("failed to register %s clock\n", node->name);
+ pr_err("failed to register %pOFn clock\n", node);
goto err_unmap_lock;
}

ret = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &pll_clk->hw);
if (ret) {
- pr_err("failed to add hw provider for %s clock\n", node->name);
+ pr_err("failed to add hw provider for %pOFn clock\n", node);
goto err_unregister_clk;
}

diff --git a/drivers/clk/bcm/clk-kona-setup.c b/drivers/clk/bcm/clk-kona-setup.c
index 281f4322355c..e65eeef9cbaf 100644
--- a/drivers/clk/bcm/clk-kona-setup.c
+++ b/drivers/clk/bcm/clk-kona-setup.c
@@ -808,29 +808,29 @@ void __init kona_dt_ccu_setup(struct ccu_data *ccu,

ret = of_address_to_resource(node, 0, &res);
if (ret) {
- pr_err("%s: no valid CCU registers found for %s\n", __func__,
- node->name);
+ pr_err("%s: no valid CCU registers found for %pOFn\n", __func__,
+ node);
goto out_err;
}

range = resource_size(&res);
if (range > (resource_size_t)U32_MAX) {
- pr_err("%s: address range too large for %s\n", __func__,
- node->name);
+ pr_err("%s: address range too large for %pOFn\n", __func__,
+ node);
goto out_err;
}

ccu->range = (u32)range;

if (!ccu_data_valid(ccu)) {
- pr_err("%s: ccu data not valid for %s\n", __func__, node->name);
+ pr_err("%s: ccu data not valid for %pOFn\n", __func__, node);
goto out_err;
}

ccu->base = ioremap(res.start, ccu->range);
if (!ccu->base) {
- pr_err("%s: unable to map CCU registers for %s\n", __func__,
- node->name);
+ pr_err("%s: unable to map CCU registers for %pOFn\n", __func__,
+ node);
goto out_err;
}
ccu->node = of_node_get(node);
@@ -848,16 +848,16 @@ void __init kona_dt_ccu_setup(struct ccu_data *ccu,

ret = of_clk_add_hw_provider(node, of_clk_kona_onecell_get, ccu);
if (ret) {
- pr_err("%s: error adding ccu %s as provider (%d)\n", __func__,
- node->name, ret);
+ pr_err("%s: error adding ccu %pOFn as provider (%d)\n", __func__,
+ node, ret);
goto out_err;
}

if (!kona_ccu_init(ccu))
- pr_err("Broadcom %s initialization had errors\n", node->name);
+ pr_err("Broadcom %pOFn initialization had errors\n", node);

return;
out_err:
kona_ccu_teardown(ccu);
- pr_err("Broadcom %s setup aborted\n", node->name);
+ pr_err("Broadcom %pOFn setup aborted\n", node);
}
diff --git a/drivers/clk/clk-asm9260.c b/drivers/clk/clk-asm9260.c
index 44b544157121..d571a00b5282 100644
--- a/drivers/clk/clk-asm9260.c
+++ b/drivers/clk/clk-asm9260.c
@@ -281,7 +281,7 @@ static void __init asm9260_acc_init(struct device_node *np)

base = of_io_request_and_map(np, 0, np->name);
if (IS_ERR(base))
- panic("%s: unable to map resource", np->name);
+ panic("%pOFn: unable to map resource", np);

/* register pll */
rate = (ioread32(base + HW_SYSPLLCTRL) & 0xffff) * 1000000;
@@ -292,7 +292,7 @@ static void __init asm9260_acc_init(struct device_node *np)
ref_clk, 0, rate, accuracy);

if (IS_ERR(hw))
- panic("%s: can't register REFCLK. Check DT!", np->name);
+ panic("%pOFn: can't register REFCLK. Check DT!", np);

for (n = 0; n < ARRAY_SIZE(asm9260_mux_clks); n++) {
const struct asm9260_mux_clock *mc = &asm9260_mux_clks[n];
diff --git a/drivers/clk/clk-cdce925.c b/drivers/clk/clk-cdce925.c
index 0a7e7d5a7506..49531a2a5436 100644
--- a/drivers/clk/clk-cdce925.c
+++ b/drivers/clk/clk-cdce925.c
@@ -669,8 +669,8 @@ static int cdce925_probe(struct i2c_client *client,

/* Register PLL clocks */
for (i = 0; i < data->chip_info->num_plls; ++i) {
- pll_clk_name[i] = kasprintf(GFP_KERNEL, "%s.pll%d",
- client->dev.of_node->name, i);
+ pll_clk_name[i] = kasprintf(GFP_KERNEL, "%pOFn.pll%d",
+ client->dev.of_node, i);
init.name = pll_clk_name[i];
data->pll[i].chip = data;
data->pll[i].hw.init = &init;
@@ -710,7 +710,7 @@ static int cdce925_probe(struct i2c_client *client,
init.flags = 0;
init.num_parents = 1;
init.parent_names = &parent_name; /* Mux Y1 to input */
- init.name = kasprintf(GFP_KERNEL, "%s.Y1", client->dev.of_node->name);
+ init.name = kasprintf(GFP_KERNEL, "%pOFn.Y1", client->dev.of_node);
data->clk[0].chip = data;
data->clk[0].hw.init = &init;
data->clk[0].index = 0;
@@ -727,8 +727,8 @@ static int cdce925_probe(struct i2c_client *client,
init.flags = CLK_SET_RATE_PARENT;
init.num_parents = 1;
for (i = 1; i < data->chip_info->num_outputs; ++i) {
- init.name = kasprintf(GFP_KERNEL, "%s.Y%d",
- client->dev.of_node->name, i+1);
+ init.name = kasprintf(GFP_KERNEL, "%pOFn.Y%d",
+ client->dev.of_node, i+1);
data->clk[i].chip = data;
data->clk[i].hw.init = &init;
data->clk[i].index = i;
diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index 20724abd38bd..ef0ca9414f37 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -158,14 +158,14 @@ static struct clk *_of_fixed_factor_clk_setup(struct device_node *node)
int ret;

if (of_property_read_u32(node, "clock-div", &div)) {
- pr_err("%s Fixed factor clock <%s> must have a clock-div property\n",
- __func__, node->name);
+ pr_err("%s Fixed factor clock <%pOFn> must have a clock-div property\n",
+ __func__, node);
return ERR_PTR(-EIO);
}

if (of_property_read_u32(node, "clock-mult", &mult)) {
- pr_err("%s Fixed factor clock <%s> must have a clock-mult property\n",
- __func__, node->name);
+ pr_err("%s Fixed factor clock <%pOFn> must have a clock-mult property\n",
+ __func__, node);
return ERR_PTR(-EIO);
}

diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
index 40af4fbab4d2..6a43ce420492 100644
--- a/drivers/clk/clk-gpio.c
+++ b/drivers/clk/clk-gpio.c
@@ -233,11 +233,11 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
if (IS_ERR(gpiod)) {
ret = PTR_ERR(gpiod);
if (ret == -EPROBE_DEFER)
- pr_debug("%s: %s: GPIOs not yet available, retry later\n",
- node->name, __func__);
+ pr_debug("%pOFn: %s: GPIOs not yet available, retry later\n",
+ node, __func__);
else
- pr_err("%s: %s: Can't get '%s' named GPIO property\n",
- node->name, __func__,
+ pr_err("%pOFn: %s: Can't get '%s' named GPIO property\n",
+ node, __func__,
gpio_name);
return ret;
}
diff --git a/drivers/clk/clk-hsdk-pll.c b/drivers/clk/clk-hsdk-pll.c
index c4ee280f454d..a47c2b600f20 100644
--- a/drivers/clk/clk-hsdk-pll.c
+++ b/drivers/clk/clk-hsdk-pll.c
@@ -390,13 +390,13 @@ static void __init of_hsdk_pll_clk_setup(struct device_node *node)

ret = clk_hw_register(NULL, &pll_clk->hw);
if (ret) {
- pr_err("failed to register %s clock\n", node->name);
+ pr_err("failed to register %pOFn clock\n", node);
goto err_unmap_spec_regs;
}

ret = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &pll_clk->hw);
if (ret) {
- pr_err("failed to add hw provider for %s clock\n", node->name);
+ pr_err("failed to add hw provider for %pOFn clock\n", node);
goto err_unmap_spec_regs;
}

diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c
index 13ad6d1e5090..84a24875c629 100644
--- a/drivers/clk/clk-nomadik.c
+++ b/drivers/clk/clk-nomadik.c
@@ -97,8 +97,8 @@ static void __init nomadik_src_init(void)
}
src_base = of_iomap(np, 0);
if (!src_base) {
- pr_err("%s: must have src parent node with REGS (%s)\n",
- __func__, np->name);
+ pr_err("%s: must have src parent node with REGS (%pOFn)\n",
+ __func__, np);
return;
}

diff --git a/drivers/clk/clk-npcm7xx.c b/drivers/clk/clk-npcm7xx.c
index 740af90a9508..afb0eb106953 100644
--- a/drivers/clk/clk-npcm7xx.c
+++ b/drivers/clk/clk-npcm7xx.c
@@ -549,7 +549,7 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)

ret = of_address_to_resource(clk_np, 0, &res);
if (ret) {
- pr_err("%s: failed to get resource, ret %d\n", clk_np->name,
+ pr_err("%pOFn: failed to get resource, ret %d\n", clk_np,
ret);
return;
}
diff --git a/drivers/clk/clk-palmas.c b/drivers/clk/clk-palmas.c
index 7f51c01085ab..e9612e7068e9 100644
--- a/drivers/clk/clk-palmas.c
+++ b/drivers/clk/clk-palmas.c
@@ -195,8 +195,8 @@ static void palmas_clks_get_clk_data(struct platform_device *pdev,
prop = PALMAS_EXT_CONTROL_NSLEEP;
break;
default:
- dev_warn(&pdev->dev, "%s: Invalid ext control option: %u\n",
- node->name, prop);
+ dev_warn(&pdev->dev, "%pOFn: Invalid ext control option: %u\n",
+ node, prop);
prop = 0;
break;
}
diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 3a1812f65e5d..4c30b6e799ed 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -945,8 +945,8 @@ static void __init core_mux_init(struct device_node *np)

rc = of_clk_add_provider(np, of_clk_src_simple_get, clk);
if (rc) {
- pr_err("%s: Couldn't register clk provider for node %s: %d\n",
- __func__, np->name, rc);
+ pr_err("%s: Couldn't register clk provider for node %pOFn: %d\n",
+ __func__, np, rc);
return;
}
}
@@ -1199,8 +1199,8 @@ static void __init legacy_pll_init(struct device_node *np, int idx)

rc = of_clk_add_provider(np, of_clk_src_onecell_get, onecell_data);
if (rc) {
- pr_err("%s: Couldn't register clk provider for node %s: %d\n",
- __func__, np->name, rc);
+ pr_err("%s: Couldn't register clk provider for node %pOFn: %d\n",
+ __func__, np, rc);
goto err_cell;
}

@@ -1360,7 +1360,7 @@ static void __init clockgen_init(struct device_node *np)
is_old_ls1021a = true;
}
if (!clockgen.regs) {
- pr_err("%s(): %s: of_iomap() failed\n", __func__, np->name);
+ pr_err("%s(): %pOFn: of_iomap() failed\n", __func__, np);
return;
}

@@ -1406,8 +1406,8 @@ static void __init clockgen_init(struct device_node *np)

ret = of_clk_add_provider(np, clockgen_clk_get, &clockgen);
if (ret) {
- pr_err("%s: Couldn't register clk provider for node %s: %d\n",
- __func__, np->name, ret);
+ pr_err("%s: Couldn't register clk provider for node %pOFn: %d\n",
+ __func__, np, ret);
}

return;
diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
index a985bf5e1ac6..a2287c770d5c 100644
--- a/drivers/clk/clk-scmi.c
+++ b/drivers/clk/clk-scmi.c
@@ -132,7 +132,7 @@ static int scmi_clocks_probe(struct scmi_device *sdev)

count = handle->clk_ops->count_get(handle);
if (count < 0) {
- dev_err(dev, "%s: invalid clock output count\n", np->name);
+ dev_err(dev, "%pOFn: invalid clock output count\n", np);
return -EINVAL;
}

diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c
index 25854722810e..d3ccc1cfccd5 100644
--- a/drivers/clk/clk-scpi.c
+++ b/drivers/clk/clk-scpi.c
@@ -207,7 +207,7 @@ static int scpi_clk_add(struct device *dev, struct device_node *np,

count = of_property_count_strings(np, "clock-output-names");
if (count < 0) {
- dev_err(dev, "%s: invalid clock output count\n", np->name);
+ dev_err(dev, "%pOFn: invalid clock output count\n", np);
return -EINVAL;
}

@@ -232,13 +232,13 @@ static int scpi_clk_add(struct device *dev, struct device_node *np,

if (of_property_read_string_index(np, "clock-output-names",
idx, &name)) {
- dev_err(dev, "invalid clock name @ %s\n", np->name);
+ dev_err(dev, "invalid clock name @ %pOFn\n", np);
return -EINVAL;
}

if (of_property_read_u32_index(np, "clock-indices",
idx, &val)) {
- dev_err(dev, "invalid clock index @ %s\n", np->name);
+ dev_err(dev, "invalid clock index @ %pOFn\n", np);
return -EINVAL;
}

diff --git a/drivers/clk/clk-si5351.c b/drivers/clk/clk-si5351.c
index 50e7c341e97e..8bdf91b56012 100644
--- a/drivers/clk/clk-si5351.c
+++ b/drivers/clk/clk-si5351.c
@@ -1215,8 +1215,8 @@ static int si5351_dt_parse(struct i2c_client *client,
/* per clkout properties */
for_each_child_of_node(np, child) {
if (of_property_read_u32(child, "reg", &num)) {
- dev_err(&client->dev, "missing reg property of %s\n",
- child->name);
+ dev_err(&client->dev, "missing reg property of %pOFn\n",
+ child);
goto put_child;
}

diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c
index 294850bdc195..cdaa567c8042 100644
--- a/drivers/clk/clk-stm32f4.c
+++ b/drivers/clk/clk-stm32f4.c
@@ -1433,7 +1433,7 @@ static void __init stm32f4_rcc_init(struct device_node *np)

base = of_iomap(np, 0);
if (!base) {
- pr_err("%s: unable to map resource\n", np->name);
+ pr_err("%pOFn: unable to map resource\n", np);
return;
}

diff --git a/drivers/clk/clk-stm32h7.c b/drivers/clk/clk-stm32h7.c
index d3271eca3779..0ea7261d15e0 100644
--- a/drivers/clk/clk-stm32h7.c
+++ b/drivers/clk/clk-stm32h7.c
@@ -1216,7 +1216,7 @@ static void __init stm32h7_rcc_init(struct device_node *np)
/* get RCC base @ from DT */
base = of_iomap(np, 0);
if (!base) {
- pr_err("%s: unable to map resource", np->name);
+ pr_err("%pOFn: unable to map resource", np);
goto err_free_clks;
}

diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c
index a907555b2a3d..4f48342bc280 100644
--- a/drivers/clk/clk-stm32mp1.c
+++ b/drivers/clk/clk-stm32mp1.c
@@ -2088,7 +2088,7 @@ static void stm32mp1_rcc_init(struct device_node *np)

base = of_iomap(np, 0);
if (!base) {
- pr_err("%s: unable to map resource", np->name);
+ pr_err("%pOFn: unable to map resource", np);
of_node_put(np);
return;
}
diff --git a/drivers/clk/clk-tango4.c b/drivers/clk/clk-tango4.c
index 34b22b7930fb..fe12a43f7a40 100644
--- a/drivers/clk/clk-tango4.c
+++ b/drivers/clk/clk-tango4.c
@@ -54,13 +54,13 @@ static void __init tango4_clkgen_setup(struct device_node *np)
const char *parent = of_clk_get_parent_name(np, 0);

if (!base)
- panic("%s: invalid address\n", np->name);
+ panic("%pOFn: invalid address\n", np);

if (readl(base + CPUCLK_DIV) & DIV_BYPASS)
- panic("%s: unsupported cpuclk setup\n", np->name);
+ panic("%pOFn: unsupported cpuclk setup\n", np);

if (readl(base + SYSCLK_DIV) & DIV_BYPASS)
- panic("%s: unsupported sysclk setup\n", np->name);
+ panic("%pOFn: unsupported sysclk setup\n", np);

writel(0x100, base + CPUCLK_DIV); /* disable frequency ramping */

@@ -77,9 +77,9 @@ static void __init tango4_clkgen_setup(struct device_node *np)
pp[3] = clk_register_fixed_factor(NULL, "sdio_clk", "cd6", 0, 1, 2);

if (IS_ERR(pp[0]) || IS_ERR(pp[1]) || IS_ERR(pp[2]) || IS_ERR(pp[3]))
- panic("%s: clk registration failed\n", np->name);
+ panic("%pOFn: clk registration failed\n", np);

if (of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data))
- panic("%s: clk provider registration failed\n", np->name);
+ panic("%pOFn: clk provider registration failed\n", np);
}
CLK_OF_DECLARE(tango4_clkgen, "sigma,tango4-clkgen", tango4_clkgen_setup);
diff --git a/drivers/clk/keystone/gate.c b/drivers/clk/keystone/gate.c
index aed5af23895b..def15db4eef0 100644
--- a/drivers/clk/keystone/gate.c
+++ b/drivers/clk/keystone/gate.c
@@ -245,7 +245,7 @@ static void __init of_psc_clk_init(struct device_node *node, spinlock_t *lock)
return;
}

- pr_err("%s: error registering clk %s\n", __func__, node->name);
+ pr_err("%s: error registering clk %pOFn\n", __func__, node);

unmap_domain:
iounmap(data->domain_base);
diff --git a/drivers/clk/keystone/pll.c b/drivers/clk/keystone/pll.c
index e7e840fb74ea..2b871fc91d56 100644
--- a/drivers/clk/keystone/pll.c
+++ b/drivers/clk/keystone/pll.c
@@ -219,7 +219,7 @@ static void __init _of_pll_clk_init(struct device_node *node, bool pllctrl)
}

out:
- pr_err("%s: error initializing pll %s\n", __func__, node->name);
+ pr_err("%s: error initializing pll %pOFn\n", __func__, node);
kfree(pll_data);
}

diff --git a/drivers/clk/renesas/clk-div6.c b/drivers/clk/renesas/clk-div6.c
index 9febbf42c3df..3ca4a047edc7 100644
--- a/drivers/clk/renesas/clk-div6.c
+++ b/drivers/clk/renesas/clk-div6.c
@@ -312,8 +312,8 @@ static void __init cpg_div6_clock_init(struct device_node *np)

num_parents = of_clk_get_parent_count(np);
if (num_parents < 1) {
- pr_err("%s: no parent found for %s DIV6 clock\n",
- __func__, np->name);
+ pr_err("%s: no parent found for %pOFn DIV6 clock\n",
+ __func__, np);
return;
}

@@ -324,8 +324,8 @@ static void __init cpg_div6_clock_init(struct device_node *np)

reg = of_iomap(np, 0);
if (reg == NULL) {
- pr_err("%s: failed to map %s DIV6 clock register\n",
- __func__, np->name);
+ pr_err("%s: failed to map %pOFn DIV6 clock register\n",
+ __func__, np);
goto error;
}

@@ -337,8 +337,8 @@ static void __init cpg_div6_clock_init(struct device_node *np)

clk = cpg_div6_register(clk_name, num_parents, parent_names, reg, NULL);
if (IS_ERR(clk)) {
- pr_err("%s: failed to register %s DIV6 clock (%ld)\n",
- __func__, np->name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn DIV6 clock (%ld)\n",
+ __func__, np, PTR_ERR(clk));
goto error;
}

diff --git a/drivers/clk/renesas/clk-emev2.c b/drivers/clk/renesas/clk-emev2.c
index a91825471c79..a587f63378b3 100644
--- a/drivers/clk/renesas/clk-emev2.c
+++ b/drivers/clk/renesas/clk-emev2.c
@@ -86,8 +86,8 @@ static void __init emev2_smu_clkdiv_init(struct device_node *np)
clk = clk_register_divider(NULL, np->name, parent_name, 0,
smu_base + reg[0], reg[1], 8, 0, &lock);
of_clk_add_provider(np, of_clk_src_simple_get, clk);
- clk_register_clkdev(clk, np->name, NULL);
- pr_debug("## %s %s %p\n", __func__, np->name, clk);
+ clk_register_clkdev(clk, np->full_name, NULL);
+ pr_debug("## %s %pOFn %p\n", __func__, np, clk);
}
CLK_OF_DECLARE(emev2_smu_clkdiv, "renesas,emev2-smu-clkdiv",
emev2_smu_clkdiv_init);
@@ -104,7 +104,7 @@ static void __init emev2_smu_gclk_init(struct device_node *np)
clk = clk_register_gate(NULL, np->name, parent_name, 0,
smu_base + reg[0], reg[1], 0, &lock);
of_clk_add_provider(np, of_clk_src_simple_get, clk);
- clk_register_clkdev(clk, np->name, NULL);
- pr_debug("## %s %s %p\n", __func__, np->name, clk);
+ clk_register_clkdev(clk, np->full_name, NULL);
+ pr_debug("## %s %pOFn %p\n", __func__, np, clk);
}
CLK_OF_DECLARE(emev2_smu_gclk, "renesas,emev2-smu-gclk", emev2_smu_gclk_init);
diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
index e82adcb16a52..b72c7344effa 100644
--- a/drivers/clk/renesas/clk-mstp.c
+++ b/drivers/clk/renesas/clk-mstp.c
@@ -239,8 +239,8 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
break;

if (clkidx >= MSTP_MAX_CLOCKS) {
- pr_err("%s: invalid clock %s %s index %u\n",
- __func__, np->name, name, clkidx);
+ pr_err("%s: invalid clock %pOFn %s index %u\n",
+ __func__, np, name, clkidx);
continue;
}

@@ -259,8 +259,8 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
*/
clk_register_clkdev(clks[clkidx], name, NULL);
} else {
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clks[clkidx]));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clks[clkidx]));
}
}

diff --git a/drivers/clk/renesas/clk-r8a73a4.c b/drivers/clk/renesas/clk-r8a73a4.c
index 7b903ce4c901..48e9f1e816ad 100644
--- a/drivers/clk/renesas/clk-r8a73a4.c
+++ b/drivers/clk/renesas/clk-r8a73a4.c
@@ -228,8 +228,8 @@ static void __init r8a73a4_cpg_clocks_init(struct device_node *np)

clk = r8a73a4_cpg_register_clock(np, cpg, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-r8a7740.c b/drivers/clk/renesas/clk-r8a7740.c
index a7a30d2eca41..da781640f88f 100644
--- a/drivers/clk/renesas/clk-r8a7740.c
+++ b/drivers/clk/renesas/clk-r8a7740.c
@@ -187,8 +187,8 @@ static void __init r8a7740_cpg_clocks_init(struct device_node *np)

clk = r8a7740_cpg_register_clock(np, cpg, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-r8a7778.c b/drivers/clk/renesas/clk-r8a7778.c
index 886a8380e912..9b964611e5b6 100644
--- a/drivers/clk/renesas/clk-r8a7778.c
+++ b/drivers/clk/renesas/clk-r8a7778.c
@@ -130,8 +130,8 @@ static void __init r8a7778_cpg_clocks_init(struct device_node *np)

clk = r8a7778_cpg_register_clock(np, cpg, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-r8a7779.c b/drivers/clk/renesas/clk-r8a7779.c
index 5adcca4656c3..10019145a912 100644
--- a/drivers/clk/renesas/clk-r8a7779.c
+++ b/drivers/clk/renesas/clk-r8a7779.c
@@ -164,8 +164,8 @@ static void __init r8a7779_cpg_clocks_init(struct device_node *np)
clk = r8a7779_cpg_register_clock(np, cpg, config,
plla_mult, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-rcar-gen2.c b/drivers/clk/renesas/clk-rcar-gen2.c
index bccd62f2cb09..06c015d43167 100644
--- a/drivers/clk/renesas/clk-rcar-gen2.c
+++ b/drivers/clk/renesas/clk-rcar-gen2.c
@@ -445,8 +445,8 @@ static void __init rcar_gen2_cpg_clocks_init(struct device_node *np)

clk = rcar_gen2_cpg_register_clock(np, cpg, config, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-rz.c b/drivers/clk/renesas/clk-rz.c
index ac2f86d626b6..8ac904912439 100644
--- a/drivers/clk/renesas/clk-rz.c
+++ b/drivers/clk/renesas/clk-rz.c
@@ -113,8 +113,8 @@ static void __init rz_cpg_clocks_init(struct device_node *np)

clk = rz_cpg_register_clock(np, cpg, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/renesas/clk-sh73a0.c b/drivers/clk/renesas/clk-sh73a0.c
index bab33610eb6c..2f44e0dd7afa 100644
--- a/drivers/clk/renesas/clk-sh73a0.c
+++ b/drivers/clk/renesas/clk-sh73a0.c
@@ -206,8 +206,8 @@ static void __init sh73a0_cpg_clocks_init(struct device_node *np)

clk = sh73a0_cpg_register_clock(np, cpg, name);
if (IS_ERR(clk))
- pr_err("%s: failed to register %s %s clock (%ld)\n",
- __func__, np->name, name, PTR_ERR(clk));
+ pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+ __func__, np, name, PTR_ERR(clk));
else
cpg->data.clks[i] = clk;
}
diff --git a/drivers/clk/st/clkgen-fsyn.c b/drivers/clk/st/clkgen-fsyn.c
index a79d81985c4e..cfa000007622 100644
--- a/drivers/clk/st/clkgen-fsyn.c
+++ b/drivers/clk/st/clkgen-fsyn.c
@@ -936,7 +936,7 @@ static void __init st_of_quadfs_setup(struct device_node *np,
if (!clk_parent_name)
return;

- pll_name = kasprintf(GFP_KERNEL, "%s.pll", np->name);
+ pll_name = kasprintf(GFP_KERNEL, "%pOFn.pll", np);
if (!pll_name)
return;

diff --git a/drivers/clk/sunxi/clk-mod0.c b/drivers/clk/sunxi/clk-mod0.c
index a27c264cc9b4..fc0278a1acc7 100644
--- a/drivers/clk/sunxi/clk-mod0.c
+++ b/drivers/clk/sunxi/clk-mod0.c
@@ -140,8 +140,8 @@ static void __init sun9i_a80_mod0_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for mod0-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for mod0-clk: %pOFn\n",
+ node);
return;
}

@@ -306,7 +306,7 @@ static void __init sunxi_mmc_setup(struct device_node *node,

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Couldn't map the %s clock registers\n", node->name);
+ pr_err("Couldn't map the %pOFn clock registers\n", node);
return;
}

diff --git a/drivers/clk/sunxi/clk-sun9i-core.c b/drivers/clk/sunxi/clk-sun9i-core.c
index e9295c286d5d..7e21b2b10c94 100644
--- a/drivers/clk/sunxi/clk-sun9i-core.c
+++ b/drivers/clk/sunxi/clk-sun9i-core.c
@@ -88,8 +88,8 @@ static void __init sun9i_a80_pll4_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for a80-pll4-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for a80-pll4-clk: %pOFn\n",
+ node);
return;
}

@@ -142,8 +142,8 @@ static void __init sun9i_a80_gt_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for a80-gt-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for a80-gt-clk: %pOFn\n",
+ node);
return;
}

@@ -197,8 +197,8 @@ static void __init sun9i_a80_ahb_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for a80-ahb-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for a80-ahb-clk: %pOFn\n",
+ node);
return;
}

@@ -223,8 +223,8 @@ static void __init sun9i_a80_apb0_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for a80-apb0-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for a80-apb0-clk: %pOFn\n",
+ node);
return;
}

@@ -280,8 +280,8 @@ static void __init sun9i_a80_apb1_setup(struct device_node *node)

reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg)) {
- pr_err("Could not get registers for a80-apb1-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for a80-apb1-clk: %pOFn\n",
+ node);
return;
}

diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 012714d94b42..892c29030b7b 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -568,8 +568,8 @@ static struct clk * __init sunxi_factors_clk_setup(struct device_node *node,

reg = of_iomap(node, 0);
if (!reg) {
- pr_err("Could not get registers for factors-clk: %s\n",
- node->name);
+ pr_err("Could not get registers for factors-clk: %pOFn\n",
+ node);
return NULL;
}

diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c
index 61c126a5d26a..222f68bc3f2a 100644
--- a/drivers/clk/ti/apll.c
+++ b/drivers/clk/ti/apll.c
@@ -143,8 +143,8 @@ static void __init omap_clk_register_apll(void *user,

clk = of_clk_get(node, 0);
if (IS_ERR(clk)) {
- pr_debug("clk-ref for %s not ready, retry\n",
- node->name);
+ pr_debug("clk-ref for %pOFn not ready, retry\n",
+ node);
if (!ti_clk_retry_init(node, hw, omap_clk_register_apll))
return;

@@ -155,8 +155,8 @@ static void __init omap_clk_register_apll(void *user,

clk = of_clk_get(node, 1);
if (IS_ERR(clk)) {
- pr_debug("clk-bypass for %s not ready, retry\n",
- node->name);
+ pr_debug("clk-bypass for %pOFn not ready, retry\n",
+ node);
if (!ti_clk_retry_init(node, hw, omap_clk_register_apll))
return;

@@ -202,7 +202,7 @@ static void __init of_dra7_apll_setup(struct device_node *node)

init->num_parents = of_clk_get_parent_count(node);
if (init->num_parents < 1) {
- pr_err("dra7 apll %s must have parent(s)\n", node->name);
+ pr_err("dra7 apll %pOFn must have parent(s)\n", node);
goto cleanup;
}

@@ -366,7 +366,7 @@ static void __init of_omap2_apll_setup(struct device_node *node)

init->num_parents = of_clk_get_parent_count(node);
if (init->num_parents != 1) {
- pr_err("%s must have one parent\n", node->name);
+ pr_err("%pOFn must have one parent\n", node);
goto cleanup;
}

@@ -374,13 +374,13 @@ static void __init of_omap2_apll_setup(struct device_node *node)
init->parent_names = &parent_name;

if (of_property_read_u32(node, "ti,clock-frequency", &val)) {
- pr_err("%s missing clock-frequency\n", node->name);
+ pr_err("%pOFn missing clock-frequency\n", node);
goto cleanup;
}
clk_hw->fixed_rate = val;

if (of_property_read_u32(node, "ti,bit-shift", &val)) {
- pr_err("%s missing bit-shift\n", node->name);
+ pr_err("%pOFn missing bit-shift\n", node);
goto cleanup;
}

@@ -389,7 +389,7 @@ static void __init of_omap2_apll_setup(struct device_node *node)
ad->autoidle_mask = 0x3 << val;

if (of_property_read_u32(node, "ti,idlest-shift", &val)) {
- pr_err("%s missing idlest-shift\n", node->name);
+ pr_err("%pOFn missing idlest-shift\n", node);
goto cleanup;
}

diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c
index 148815470431..a01ca9395179 100644
--- a/drivers/clk/ti/clk-dra7-atl.c
+++ b/drivers/clk/ti/clk-dra7-atl.c
@@ -190,8 +190,8 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)
init.num_parents = of_clk_get_parent_count(node);

if (init.num_parents != 1) {
- pr_err("%s: atl clock %s must have 1 parent\n", __func__,
- node->name);
+ pr_err("%s: atl clock %pOFn must have 1 parent\n", __func__,
+ node);
goto cleanup;
}

diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c
index 7d22e1af2247..be04214970cf 100644
--- a/drivers/clk/ti/clk.c
+++ b/drivers/clk/ti/clk.c
@@ -223,7 +223,7 @@ int __init ti_clk_retry_init(struct device_node *node, void *user,
{
struct clk_init_item *retry;

- pr_debug("%s: adding to retry list...\n", node->name);
+ pr_debug("%pOFn: adding to retry list...\n", node);
retry = kzalloc(sizeof(*retry), GFP_KERNEL);
if (!retry)
return -ENOMEM;
@@ -258,14 +258,14 @@ int ti_clk_get_reg_addr(struct device_node *node, int index,
}

if (i == CLK_MAX_MEMMAPS) {
- pr_err("clk-provider not found for %s!\n", node->name);
+ pr_err("clk-provider not found for %pOFn!\n", node);
return -ENOENT;
}

reg->index = i;

if (of_property_read_u32_index(node, "reg", index, &val)) {
- pr_err("%s must have reg[%d]!\n", node->name, index);
+ pr_err("%pOFn must have reg[%d]!\n", node, index);
return -EINVAL;
}

@@ -312,7 +312,7 @@ int __init omap2_clk_provider_init(struct device_node *parent, int index,
/* get clocks for this parent */
clocks = of_get_child_by_name(parent, "clocks");
if (!clocks) {
- pr_err("%s missing 'clocks' child node.\n", parent->name);
+ pr_err("%pOFn missing 'clocks' child node.\n", parent);
return -EINVAL;
}

@@ -365,7 +365,7 @@ void ti_dt_clk_init_retry_clks(void)

while (!list_empty(&retry_list) && retries) {
list_for_each_entry_safe(retry, tmp, &retry_list, link) {
- pr_debug("retry-init: %s\n", retry->node->name);
+ pr_debug("retry-init: %pOFn\n", retry->node);
retry->func(retry->user, retry->node);
list_del(&retry->link);
kfree(retry);
diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c
index 421b05392220..240e911a3db9 100644
--- a/drivers/clk/ti/clkctrl.c
+++ b/drivers/clk/ti/clkctrl.c
@@ -259,8 +259,8 @@ _ti_clkctrl_clk_register(struct omap_clkctrl_provider *provider,
struct omap_clkctrl_clk *clkctrl_clk;
int ret = 0;

- init.name = kasprintf(GFP_KERNEL, "%s:%s:%04x:%d", node->parent->name,
- node->name, offset, bit);
+ init.name = kasprintf(GFP_KERNEL, "%pOFn:%pOFn:%04x:%d", node->parent,
+ node, offset, bit);
clkctrl_clk = kzalloc(sizeof(*clkctrl_clk), GFP_KERNEL);
if (!init.name || !clkctrl_clk) {
ret = -ENOMEM;
@@ -492,8 +492,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)

provider->base = of_iomap(node, 0);

- provider->clkdm_name = kmalloc(strlen(node->parent->name) + 3,
- GFP_KERNEL);
+ provider->clkdm_name = kasprintf(GFP_KERNEL, "%pOFnxxx", node->parent);
if (!provider->clkdm_name) {
kfree(provider);
return;
@@ -503,8 +502,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
* Create default clkdm name, replace _cm from end of parent node
* name with _clkdm
*/
- strcpy(provider->clkdm_name, node->parent->name);
- provider->clkdm_name[strlen(provider->clkdm_name) - 2] = 0;
+ provider->clkdm_name[strlen(provider->clkdm_name) - 5] = 0;
strcat(provider->clkdm_name, "clkdm");

INIT_LIST_HEAD(&provider->clocks);
@@ -539,8 +537,8 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
init.flags = 0;
if (reg_data->flags & CLKF_SET_RATE_PARENT)
init.flags |= CLK_SET_RATE_PARENT;
- init.name = kasprintf(GFP_KERNEL, "%s:%s:%04x:%d",
- node->parent->name, node->name,
+ init.name = kasprintf(GFP_KERNEL, "%pOFn:%pOFn:%04x:%d",
+ node->parent, node,
reg_data->offset, 0);
clkctrl_clk = kzalloc(sizeof(*clkctrl_clk), GFP_KERNEL);
if (!init.name || !clkctrl_clk)
diff --git a/drivers/clk/ti/composite.c b/drivers/clk/ti/composite.c
index 030e8b2c1050..6a89936ba03a 100644
--- a/drivers/clk/ti/composite.c
+++ b/drivers/clk/ti/composite.c
@@ -135,8 +135,8 @@ static void __init _register_composite(void *user,

comp = _lookup_component(cclk->comp_nodes[i]);
if (!comp) {
- pr_debug("component %s not ready for %s, retry\n",
- cclk->comp_nodes[i]->name, node->name);
+ pr_debug("component %s not ready for %pOFn, retry\n",
+ cclk->comp_nodes[i]->name, node);
if (!ti_clk_retry_init(node, hw,
_register_composite))
return;
@@ -144,8 +144,8 @@ static void __init _register_composite(void *user,
goto cleanup;
}
if (cclk->comp_clks[comp->type] != NULL) {
- pr_err("duplicate component types for %s (%s)!\n",
- node->name, component_clk_types[comp->type]);
+ pr_err("duplicate component types for %pOFn (%s)!\n",
+ node, component_clk_types[comp->type]);
goto cleanup;
}

@@ -168,7 +168,7 @@ static void __init _register_composite(void *user,
}

if (!num_parents) {
- pr_err("%s: no parents found for %s!\n", __func__, node->name);
+ pr_err("%s: no parents found for %pOFn!\n", __func__, node);
goto cleanup;
}

@@ -212,7 +212,7 @@ static void __init of_ti_composite_clk_setup(struct device_node *node)
num_clks = of_clk_get_parent_count(node);

if (!num_clks) {
- pr_err("composite clk %s must have component(s)\n", node->name);
+ pr_err("composite clk %pOFn must have component(s)\n", node);
return;
}

@@ -248,7 +248,7 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
num_parents = of_clk_get_parent_count(node);

if (!num_parents) {
- pr_err("component-clock %s must have parent(s)\n", node->name);
+ pr_err("component-clock %pOFn must have parent(s)\n", node);
return -EINVAL;
}

diff --git a/drivers/clk/ti/divider.c b/drivers/clk/ti/divider.c
index ccfb4d9a152a..4fcb337a6d1c 100644
--- a/drivers/clk/ti/divider.c
+++ b/drivers/clk/ti/divider.c
@@ -492,7 +492,7 @@ __init ti_clk_get_div_table(struct device_node *node)
}

if (!valid_div) {
- pr_err("no valid dividers for %s table\n", node->name);
+ pr_err("no valid dividers for %pOFn table\n", node);
return ERR_PTR(-EINVAL);
}

@@ -530,7 +530,7 @@ static int _get_divider_width(struct device_node *node,
min_div = 1;

if (of_property_read_u32(node, "ti,max-div", &max_div)) {
- pr_err("no max-div for %s!\n", node->name);
+ pr_err("no max-div for %pOFn!\n", node);
return -EINVAL;
}

diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
index dc86d07d0921..2e80c5ead74a 100644
--- a/drivers/clk/ti/dpll.c
+++ b/drivers/clk/ti/dpll.c
@@ -162,8 +162,8 @@ static void __init _register_dpll(void *user,

clk = of_clk_get(node, 0);
if (IS_ERR(clk)) {
- pr_debug("clk-ref missing for %s, retry later\n",
- node->name);
+ pr_debug("clk-ref missing for %pOFn, retry later\n",
+ node);
if (!ti_clk_retry_init(node, hw, _register_dpll))
return;

@@ -175,8 +175,8 @@ static void __init _register_dpll(void *user,
clk = of_clk_get(node, 1);

if (IS_ERR(clk)) {
- pr_debug("clk-bypass missing for %s, retry later\n",
- node->name);
+ pr_debug("clk-bypass missing for %pOFn, retry later\n",
+ node);
if (!ti_clk_retry_init(node, hw, _register_dpll))
return;

@@ -226,7 +226,7 @@ static void _register_dpll_x2(struct device_node *node,

parent_name = of_clk_get_parent_name(node, 0);
if (!parent_name) {
- pr_err("%s must have parent\n", node->name);
+ pr_err("%pOFn must have parent\n", node);
return;
}

@@ -305,7 +305,7 @@ static void __init of_ti_dpll_setup(struct device_node *node,

init->num_parents = of_clk_get_parent_count(node);
if (!init->num_parents) {
- pr_err("%s must have parent(s)\n", node->name);
+ pr_err("%pOFn must have parent(s)\n", node);
goto cleanup;
}

diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c
index 071af44b1ba8..ed24f20f63c7 100644
--- a/drivers/clk/ti/fapll.c
+++ b/drivers/clk/ti/fapll.c
@@ -555,7 +555,7 @@ static void __init ti_fapll_setup(struct device_node *node)

init->num_parents = of_clk_get_parent_count(node);
if (init->num_parents != 2) {
- pr_err("%s must have two parents\n", node->name);
+ pr_err("%pOFn must have two parents\n", node);
goto free;
}

@@ -564,19 +564,19 @@ static void __init ti_fapll_setup(struct device_node *node)

fd->clk_ref = of_clk_get(node, 0);
if (IS_ERR(fd->clk_ref)) {
- pr_err("%s could not get clk_ref\n", node->name);
+ pr_err("%pOFn could not get clk_ref\n", node);
goto free;
}

fd->clk_bypass = of_clk_get(node, 1);
if (IS_ERR(fd->clk_bypass)) {
- pr_err("%s could not get clk_bypass\n", node->name);
+ pr_err("%pOFn could not get clk_bypass\n", node);
goto free;
}

fd->base = of_iomap(node, 0);
if (!fd->base) {
- pr_err("%s could not get IO base\n", node->name);
+ pr_err("%pOFn could not get IO base\n", node);
goto free;
}

diff --git a/drivers/clk/ti/fixed-factor.c b/drivers/clk/ti/fixed-factor.c
index 0174a51a4ba6..7cbe896db071 100644
--- a/drivers/clk/ti/fixed-factor.c
+++ b/drivers/clk/ti/fixed-factor.c
@@ -42,12 +42,12 @@ static void __init of_ti_fixed_factor_clk_setup(struct device_node *node)
u32 flags = 0;

if (of_property_read_u32(node, "ti,clock-div", &div)) {
- pr_err("%s must have a clock-div property\n", node->name);
+ pr_err("%pOFn must have a clock-div property\n", node);
return;
}

if (of_property_read_u32(node, "ti,clock-mult", &mult)) {
- pr_err("%s must have a clock-mult property\n", node->name);
+ pr_err("%pOFn must have a clock-mult property\n", node);
return;
}

diff --git a/drivers/clk/ti/gate.c b/drivers/clk/ti/gate.c
index 935b2de5fb88..d4b5638e8b99 100644
--- a/drivers/clk/ti/gate.c
+++ b/drivers/clk/ti/gate.c
@@ -179,7 +179,7 @@ static void __init _of_ti_gate_clk_setup(struct device_node *node,
}

if (of_clk_get_parent_count(node) != 1) {
- pr_err("%s must have 1 parent\n", node->name);
+ pr_err("%pOFn must have 1 parent\n", node);
return;
}

diff --git a/drivers/clk/ti/interface.c b/drivers/clk/ti/interface.c
index 41ae7021670e..87e00c2ee957 100644
--- a/drivers/clk/ti/interface.c
+++ b/drivers/clk/ti/interface.c
@@ -84,7 +84,7 @@ static void __init _of_ti_interface_clk_setup(struct device_node *node,

parent_name = of_clk_get_parent_name(node, 0);
if (!parent_name) {
- pr_err("%s must have a parent\n", node->name);
+ pr_err("%pOFn must have a parent\n", node);
return;
}

diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c
index 69a4308a5a98..18be7eb51546 100644
--- a/drivers/clk/ti/mux.c
+++ b/drivers/clk/ti/mux.c
@@ -186,7 +186,7 @@ static void of_mux_clk_setup(struct device_node *node)

num_parents = of_clk_get_parent_count(node);
if (num_parents < 2) {
- pr_err("mux-clock %s must have parents\n", node->name);
+ pr_err("mux-clock %pOFn must have parents\n", node);
return;
}
parent_names = kzalloc((sizeof(char *) * num_parents), GFP_KERNEL);
@@ -278,7 +278,7 @@ static void __init of_ti_composite_mux_clk_setup(struct device_node *node)
num_parents = of_clk_get_parent_count(node);

if (num_parents < 2) {
- pr_err("%s must have parents\n", node->name);
+ pr_err("%pOFn must have parents\n", node);
goto cleanup;
}

diff --git a/drivers/clk/zynq/clkc.c b/drivers/clk/zynq/clkc.c
index 88a2cab37f62..d7b53ac8ad11 100644
--- a/drivers/clk/zynq/clkc.c
+++ b/drivers/clk/zynq/clkc.c
@@ -602,7 +602,7 @@ void __init zynq_clock_init(void)
}

if (of_address_to_resource(np, 0, &res)) {
- pr_err("%s: failed to get resource\n", np->name);
+ pr_err("%pOFn: failed to get resource\n", np);
goto np_err;
}

@@ -611,7 +611,7 @@ void __init zynq_clock_init(void)
if (slcr->data) {
zynq_clkc_base = (__force void __iomem *)slcr->data + res.start;
} else {
- pr_err("%s: Unable to get I/O memory\n", np->name);
+ pr_err("%pOFn: Unable to get I/O memory\n", np);
of_node_put(slcr);
goto np_err;
}
--
2.17.1

2018-08-28 15:47:19

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH v2] ASoC: 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: Timur Tabi <[email protected]>
Cc: Nicolin Chen <[email protected]>
Cc: Xiubo Li <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Carlo Caione <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Olivier Moysan <[email protected]>
Cc: Arnaud Pouliquen <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
v2:
- stm32_sai_sub: Unwrap now shorter line

sound/soc/fsl/fsl_esai.c | 2 +-
sound/soc/fsl/fsl_utils.c | 4 ++--
sound/soc/meson/axg-card.c | 2 +-
sound/soc/stm/stm32_sai.c | 2 +-
sound/soc/stm/stm32_sai_sub.c | 7 +++----
5 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index c1d1d06783e5..57b484768a58 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -807,7 +807,7 @@ static int fsl_esai_probe(struct platform_device *pdev)
return -ENOMEM;

esai_priv->pdev = pdev;
- strncpy(esai_priv->name, np->name, sizeof(esai_priv->name) - 1);
+ snprintf(esai_priv->name, sizeof(esai_priv->name), "%pOFn", np);

/* Get the addresses and IRQ */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
diff --git a/sound/soc/fsl/fsl_utils.c b/sound/soc/fsl/fsl_utils.c
index 7f0fa4b52223..9981668ab590 100644
--- a/sound/soc/fsl/fsl_utils.c
+++ b/sound/soc/fsl/fsl_utils.c
@@ -57,8 +57,8 @@ int fsl_asoc_get_dma_channel(struct device_node *ssi_np,
of_node_put(dma_channel_np);
return ret;
}
- snprintf((char *)dai->platform_name, DAI_NAME_SIZE, "%llx.%s",
- (unsigned long long) res.start, dma_channel_np->name);
+ snprintf((char *)dai->platform_name, DAI_NAME_SIZE, "%llx.%pOFn",
+ (unsigned long long) res.start, dma_channel_np);

iprop = of_get_property(dma_channel_np, "cell-index", NULL);
if (!iprop) {
diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c
index 2914ba0d965b..b76a5f4f1785 100644
--- a/sound/soc/meson/axg-card.c
+++ b/sound/soc/meson/axg-card.c
@@ -478,7 +478,7 @@ static int axg_card_set_be_link(struct snd_soc_card *card,

ret = axg_card_set_link_name(card, link, "be");
if (ret)
- dev_err(card->dev, "error setting %s link name\n", np->name);
+ dev_err(card->dev, "error setting %pOFn link name\n", np);

return ret;
}
diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c
index f22654253c43..d597eba61992 100644
--- a/sound/soc/stm/stm32_sai.c
+++ b/sound/soc/stm/stm32_sai.c
@@ -104,7 +104,7 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client,

if (!pdev) {
dev_err(&sai_client->pdev->dev,
- "Device not found for node %s\n", np_provider->name);
+ "Device not found for node %pOFn\n", np_provider);
return -ENODEV;
}

diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index 06fba9650ac4..56a227e0bd71 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -1124,16 +1124,15 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev,
sai->sync = SAI_SYNC_NONE;
if (args.np) {
if (args.np == np) {
- dev_err(&pdev->dev, "%s sync own reference\n",
- np->name);
+ dev_err(&pdev->dev, "%pOFn sync own reference\n", np);
of_node_put(args.np);
return -EINVAL;
}

sai->np_sync_provider = of_get_parent(args.np);
if (!sai->np_sync_provider) {
- dev_err(&pdev->dev, "%s parent node not found\n",
- np->name);
+ dev_err(&pdev->dev, "%pOFn parent node not found\n",
+ np);
of_node_put(args.np);
return -ENODEV;
}
--
2.17.1

2018-08-28 15:47:39

by Matthias Brugger

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



On 28/08/18 17:44, Rob Herring wrote:

> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-

Reviewed-by: Matthias Brugger <[email protected]>

2018-08-28 16:56:30

by Paul Burton

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

Hi Rob,

On Mon, Aug 27, 2018 at 08:52:05PM -0500, 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: Ralf Baechle <[email protected]>
> Cc: Paul Burton <[email protected]>
> Cc: James Hogan <[email protected]>
> Cc: John Crispin <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> arch/mips/cavium-octeon/octeon-irq.c | 16 ++++++++--------
> arch/mips/netlogic/common/irq.c | 14 +++++++-------
> arch/mips/ralink/cevt-rt3352.c | 6 +++---
> arch/mips/ralink/ill_acc.c | 2 +-
> 4 files changed, 19 insertions(+), 19 deletions(-)

Thanks - applied to mips-next for 4.20.

Paul

2018-08-28 16:59:03

by Florian Fainelli

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

On 08/27/2018 06:52 PM, 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: Andrew Lunn <[email protected]>
> Cc: Florian Fainelli <[email protected]>
> Cc: "David S. Miller" <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Reviewed-by: Florian Fainelli <[email protected]>
--
Florian

2018-08-28 17:04:53

by Will Deacon

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

On Mon, Aug 27, 2018 at 08:52:39PM -0500, 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: Will Deacon <[email protected]>
> Cc: Mark Rutland <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/perf/arm_pmu_platform.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)

Cheers, I can queue this up for 4.20. Let me know if you'd rather take it
along with the name pointer removal instead.

Will

> diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
> index 96075cecb0ae..933bd8410fc2 100644
> --- a/drivers/perf/arm_pmu_platform.c
> +++ b/drivers/perf/arm_pmu_platform.c
> @@ -77,14 +77,14 @@ static int pmu_parse_irq_affinity(struct device_node *node, int i)
>
> dn = of_parse_phandle(node, "interrupt-affinity", i);
> if (!dn) {
> - pr_warn("failed to parse interrupt-affinity[%d] for %s\n",
> - i, node->name);
> + pr_warn("failed to parse interrupt-affinity[%d] for %pOFn\n",
> + i, node);
> return -EINVAL;
> }
>
> cpu = of_cpu_node_to_id(dn);
> if (cpu < 0) {
> - pr_warn("failed to find logical CPU for %s\n", dn->name);
> + pr_warn("failed to find logical CPU for %pOFn\n", dn);
> cpu = nr_cpu_ids;
> }
>
> --
> 2.17.1
>

2018-08-28 18:08:47

by Mark Brown

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

On Tue, Aug 28, 2018 at 10:44:28AM -0500, Rob Herring wrote:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.

Please don't send new patches in reply to existing threads, it makes it
harder to follow what the current versions of things are.


Attachments:
(No filename) (330.00 B)
signature.asc (499.00 B)
Download all attachments

2018-08-28 18:45:12

by Guenter Roeck

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

On Mon, Aug 27, 2018 at 08:52:21PM -0500, 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/aspeed-pwm-tacho.c | 2 +-
> drivers/hwmon/ibmpowernv.c | 4 ++--
> drivers/hwmon/iio_hwmon.c | 9 ++++-----
> drivers/hwmon/npcm750-pwm-fan.c | 2 +-
> 4 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c
> index 5e449eac788a..92de8139d398 100644
> --- a/drivers/hwmon/aspeed-pwm-tacho.c
> +++ b/drivers/hwmon/aspeed-pwm-tacho.c
> @@ -852,7 +852,7 @@ static int aspeed_create_pwm_cooling(struct device *dev,
> dev_err(dev, "Property 'cooling-levels' cannot be read.\n");
> return ret;
> }
> - snprintf(cdev->name, MAX_CDEV_NAME_LEN, "%s%d", child->name, pwm_port);
> + snprintf(cdev->name, MAX_CDEV_NAME_LEN, "%pOFn%d", child, pwm_port);
>
> cdev->tcdev = thermal_of_cooling_device_register(child,
> cdev->name,
> diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
> index 83472808c816..4935897f1527 100644
> --- a/drivers/hwmon/ibmpowernv.c
> +++ b/drivers/hwmon/ibmpowernv.c
> @@ -603,8 +603,8 @@ static int create_device_attrs(struct platform_device *pdev)
> if (of_property_read_u32(np, "sensor-id", &sensor_id) &&
> of_property_read_u32(np, "sensor-data", &sensor_id)) {
> dev_info(&pdev->dev,
> - "'sensor-id' missing in the node '%s'\n",
> - np->name);
> + "'sensor-id' missing in the node '%pOFn'\n",
> + np);
> continue;
> }
>
> diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
> index 2f3f875c06ac..7566991f1c04 100644
> --- a/drivers/hwmon/iio_hwmon.c
> +++ b/drivers/hwmon/iio_hwmon.c
> @@ -65,13 +65,9 @@ static int iio_hwmon_probe(struct platform_device *pdev)
> int in_i = 1, temp_i = 1, curr_i = 1, humidity_i = 1;
> enum iio_chan_type type;
> struct iio_channel *channels;
> - const char *name = "iio_hwmon";
> struct device *hwmon_dev;
> char *sname;
>
> - if (dev->of_node && dev->of_node->name)
> - name = dev->of_node->name;
> -
> channels = devm_iio_channel_get_all(dev);
> if (IS_ERR(channels)) {
> if (PTR_ERR(channels) == -ENODEV)
> @@ -141,7 +137,10 @@ static int iio_hwmon_probe(struct platform_device *pdev)
> st->attr_group.attrs = st->attrs;
> st->groups[0] = &st->attr_group;
>
> - sname = devm_kstrdup(dev, name, GFP_KERNEL);
> + if (dev->of_node)
> + sname = devm_kasprintf(dev, GFP_KERNEL, "%pOFn", dev->of_node);
> + else
> + sname = devm_kstrdup(dev, "iio_hwmon", GFP_KERNEL);
> if (!sname)
> return -ENOMEM;
>
> diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c
> index 8474d601aa63..96634fd54e0b 100644
> --- a/drivers/hwmon/npcm750-pwm-fan.c
> +++ b/drivers/hwmon/npcm750-pwm-fan.c
> @@ -861,7 +861,7 @@ static int npcm7xx_create_pwm_cooling(struct device *dev,
> dev_err(dev, "Property 'cooling-levels' cannot be read.\n");
> return ret;
> }
> - snprintf(cdev->name, THERMAL_NAME_LENGTH, "%s%d", child->name,
> + snprintf(cdev->name, THERMAL_NAME_LENGTH, "%pOFn%d", child,
> pwm_port);
>
> cdev->tcdev = thermal_of_cooling_device_register(child,

2018-08-28 18:50:08

by Leo Li

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

On Mon, Aug 27, 2018 at 8:57 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.

Please forgive my ignorance, but what is this format specifier do
exactly? I cannot find anything listed in the printf specification
matching this. Is this something newly introduced?

Leo

2018-08-28 20:38:35

by Jacek Anaszewski

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

Hi Rob,

Thank you for the patch.

On 08/28/2018 03:52 AM, 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: Sakari Ailus <[email protected]>
> Cc: Jacek Anaszewski <[email protected]>
> Cc: Pavel Machek <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/leds/leds-as3645a.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
> index f883616d9e60..98a69b1a43f9 100644
> --- a/drivers/leds/leds-as3645a.c
> +++ b/drivers/leds/leds-as3645a.c
> @@ -529,7 +529,7 @@ static int as3645a_parse_node(struct as3645a *flash,
> strlcpy(names->flash, name, sizeof(names->flash));
> else
> snprintf(names->flash, sizeof(names->flash),
> - "%s:flash", node->name);
> + "%pOFn:flash", node);
>
> rval = of_property_read_u32(flash->flash_node, "flash-timeout-us",
> &cfg->flash_timeout_us);
> @@ -573,7 +573,7 @@ static int as3645a_parse_node(struct as3645a *flash,
> strlcpy(names->indicator, name, sizeof(names->indicator));
> else
> snprintf(names->indicator, sizeof(names->indicator),
> - "%s:indicator", node->name);
> + "%pOFn:indicator", node);
>
> rval = of_property_read_u32(flash->indicator_node, "led-max-microamp",
> &cfg->indicator_max_ua);
>

Applied.

--
Best regards,
Jacek Anaszewski

2018-08-28 22:17:09

by Tyrel Datwyler

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

On 08/28/2018 11:48 AM, Li Yang wrote:
> On Mon, Aug 27, 2018 at 8:57 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.
>
> Please forgive my ignorance, but what is this format specifier do
> exactly? I cannot find anything listed in the printf specification
> matching this. Is this something newly introduced?
>
> Leo
>

From Documentation/core-api/printk-formats.rst:

kobjects
--------

::

%pOF[fnpPcCF]


For printing kobject based structs (device nodes). Default behaviour is
equivalent to %pOFf.

- f - device node full_name
- n - device node name
- p - device node phandle
- P - device node path spec (name + @unit)
- F - device node flags
- c - major compatible string
- C - full compatible string


-Tyrel


2018-08-28 22:18:28

by Stephen Boyd

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

Quoting Rob Herring (2018-08-28 08:44:29)
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
>
> Cc: Eugeniy Paltsev <[email protected]>
> Cc: Michael Turquette <[email protected]>
> Cc: Stephen Boyd <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>


2018-08-28 22:31:10

by Leo Li

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

On Tue, Aug 28, 2018 at 5:16 PM Tyrel Datwyler
<[email protected]> wrote:
>
> On 08/28/2018 11:48 AM, Li Yang wrote:
> > On Mon, Aug 27, 2018 at 8:57 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.
> >
> > Please forgive my ignorance, but what is this format specifier do
> > exactly? I cannot find anything listed in the printf specification
> > matching this. Is this something newly introduced?
> >
> > Leo
> >
>
> From Documentation/core-api/printk-formats.rst:

I was trying to find it in the standard c format specifier. :(
Thanks a lot for the pointer.

>
> kobjects
> --------
>
> ::
>
> %pOF[fnpPcCF]
>
>
> For printing kobject based structs (device nodes). Default behaviour is
> equivalent to %pOFf.
>
> - f - device node full_name
> - n - device node name
> - p - device node phandle
> - P - device node path spec (name + @unit)
> - F - device node flags
> - c - major compatible string
> - C - full compatible string
>
>
> -Tyrel
>

2018-08-28 22:54:38

by Tyrel Datwyler

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

On 08/28/2018 03:29 PM, Li Yang wrote:
> On Tue, Aug 28, 2018 at 5:16 PM Tyrel Datwyler
> <[email protected]> wrote:
>>
>> On 08/28/2018 11:48 AM, Li Yang wrote:
>>> On Mon, Aug 27, 2018 at 8:57 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.
>>>
>>> Please forgive my ignorance, but what is this format specifier do
>>> exactly? I cannot find anything listed in the printf specification
>>> matching this. Is this something newly introduced?
>>>
>>> Leo
>>>
>>
>> From Documentation/core-api/printk-formats.rst:
>
> I was trying to find it in the standard c format specifier. :(
> Thanks a lot for the pointer.
>

No problem. Its worth a look through. The usual integer types are at the top, but that is followed by the pointer types which the kernel provides quite a few for a variety of things.

>>
>> kobjects
>> --------
>>
>> ::
>>
>> %pOF[fnpPcCF]
>>
>>
>> For printing kobject based structs (device nodes). Default behaviour is
>> equivalent to %pOFf.
>>
>> - f - device node full_name
>> - n - device node name
>> - p - device node phandle
>> - P - device node path spec (name + @unit)
>> - F - device node flags
>> - c - major compatible string
>> - C - full compatible string
>>
>>
>> -Tyrel
>>
>


2018-08-29 02:08:17

by Sean Wang

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

On Tue, 2018-08-28 at 10:44 -0500, 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: "David S. Miller" <[email protected]>
> Cc: Yisen Zhuang <[email protected]>
> Cc: Salil Mehta <[email protected]>
> Cc: Sebastian Hesselbarth <[email protected]>
> Cc: Felix Fietkau <[email protected]>
> Cc: John Crispin <[email protected]>
> Cc: Sean Wang <[email protected]>
> Cc: Nelson Chang <[email protected]>
> Cc: Matthias Brugger <[email protected]>
> Cc: Wingman Kwok <[email protected]>
> Cc: Murali Karicheri <[email protected]>
> Cc: [email protected]
>
> Signed-off-by: Rob Herring <[email protected]>
> ---
> v2:
> - fix missing brackets in netcp
>
> drivers/net/ethernet/freescale/fsl_pq_mdio.c | 4 +-
> .../net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 8 ++--
> drivers/net/ethernet/marvell/mv643xx_eth.c | 6 +--
> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-

for mtk-eth

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

> drivers/net/ethernet/sun/sunhme.c | 2 +-
> drivers/net/ethernet/ti/netcp_core.c | 22 ++++------
> drivers/net/ethernet/ti/netcp_ethss.c | 42 +++++++++----------
> 7 files changed, 40 insertions(+), 46 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
> index ac2c3f6a12bc..82722d05fedb 100644
> --- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
> +++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
> @@ -446,8 +446,8 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev)
> goto error;
> }
>
> - snprintf(new_bus->id, MII_BUS_ID_SIZE, "%s@%llx", np->name,
> - (unsigned long long)res.start);
> + snprintf(new_bus->id, MII_BUS_ID_SIZE, "%pOFn@%llx", np,
> + (unsigned long long)res.start);
>
> priv->map = of_iomap(np, 0);
> if (!priv->map) {
> diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
> index 1c2326bd76e2..6521d8d53745 100644
> --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
> +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
> @@ -807,8 +807,8 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
> */
> put_device(&mac_cb->phy_dev->mdio.dev);
>
> - dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
> - mac_cb->mac_id, np->name);
> + dev_dbg(mac_cb->dev, "mac%d phy_node: %pOFn\n",
> + mac_cb->mac_id, np);
> }
> of_node_put(np);
>
> @@ -825,8 +825,8 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
> * if the phy_dev is found
> */
> put_device(&mac_cb->phy_dev->mdio.dev);
> - dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
> - mac_cb->mac_id, np->name);
> + dev_dbg(mac_cb->dev, "mac%d phy_node: %pOFn\n",
> + mac_cb->mac_id, np);
> }
> of_node_put(np);
>
> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index 62f204f32316..1e9bcbdc6a90 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -2733,17 +2733,17 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
>
> memset(&res, 0, sizeof(res));
> if (of_irq_to_resource(pnp, 0, &res) <= 0) {
> - dev_err(&pdev->dev, "missing interrupt on %s\n", pnp->name);
> + dev_err(&pdev->dev, "missing interrupt on %pOFn\n", pnp);
> return -EINVAL;
> }
>
> if (of_property_read_u32(pnp, "reg", &ppd.port_number)) {
> - dev_err(&pdev->dev, "missing reg property on %s\n", pnp->name);
> + dev_err(&pdev->dev, "missing reg property on %pOFn\n", pnp);
> return -EINVAL;
> }
>
> if (ppd.port_number >= 3) {
> - dev_err(&pdev->dev, "invalid reg property on %s\n", pnp->name);
> + dev_err(&pdev->dev, "invalid reg property on %pOFn\n", pnp);
> return -EINVAL;
> }
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index 6e6abdc399de..b44bcfd85b05 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -405,7 +405,7 @@ static int mtk_mdio_init(struct mtk_eth *eth)
> eth->mii_bus->priv = eth;
> eth->mii_bus->parent = eth->dev;
>
> - snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%s", mii_np->name);
> + snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%pOFn", mii_np);
> ret = of_mdiobus_register(eth->mii_bus, mii_np);
>
> err_put_node:
> diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
> index 06da2f59fcbf..863fd602fd33 100644
> --- a/drivers/net/ethernet/sun/sunhme.c
> +++ b/drivers/net/ethernet/sun/sunhme.c
> @@ -2999,7 +2999,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
> /* Now make sure pci_dev cookie is there. */
> #ifdef CONFIG_SPARC
> dp = pci_device_to_OF_node(pdev);
> - strcpy(prom_name, dp->name);
> + snprintf(prom_name, sizeof(prom_name), "%pOFn", dp);
> #else
> if (is_quattro_p(pdev))
> strcpy(prom_name, "SUNW,qfe");
> diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
> index a1d335a3c5e4..1f612268c998 100644
> --- a/drivers/net/ethernet/ti/netcp_core.c
> +++ b/drivers/net/ethernet/ti/netcp_core.c
> @@ -225,17 +225,6 @@ static int emac_arch_get_mac_addr(char *x, void __iomem *efuse_mac, u32 swap)
> return 0;
> }
>
> -static const char *netcp_node_name(struct device_node *node)
> -{
> - const char *name;
> -
> - if (of_property_read_string(node, "label", &name) < 0)
> - name = node->name;
> - if (!name)
> - name = "unknown";
> - return name;
> -}
> -
> /* Module management routines */
> static int netcp_register_interface(struct netcp_intf *netcp)
> {
> @@ -267,8 +256,13 @@ static int netcp_module_probe(struct netcp_device *netcp_device,
> }
>
> for_each_available_child_of_node(devices, child) {
> - const char *name = netcp_node_name(child);
> + const char *name;
> + char node_name[32];
>
> + if (of_property_read_string(node, "label", &name) < 0) {
> + snprintf(node_name, sizeof(node_name), "%pOFn", child);
> + name = node_name;
> + }
> if (!strcasecmp(module->name, name))
> break;
> }
> @@ -2209,8 +2203,8 @@ static int netcp_probe(struct platform_device *pdev)
> for_each_available_child_of_node(interfaces, child) {
> ret = netcp_create_interface(netcp_device, child);
> if (ret) {
> - dev_err(dev, "could not create interface(%s)\n",
> - child->name);
> + dev_err(dev, "could not create interface(%pOFn)\n",
> + child);
> goto probe_quit_interface;
> }
> }
> diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
> index 72b98e27c992..0397ccb6597e 100644
> --- a/drivers/net/ethernet/ti/netcp_ethss.c
> +++ b/drivers/net/ethernet/ti/netcp_ethss.c
> @@ -3137,15 +3137,15 @@ static void init_secondary_ports(struct gbe_priv *gbe_dev,
> for_each_child_of_node(node, port) {
> slave = devm_kzalloc(dev, sizeof(*slave), GFP_KERNEL);
> if (!slave) {
> - dev_err(dev, "memory alloc failed for secondary port(%s), skipping...\n",
> - port->name);
> + dev_err(dev, "memory alloc failed for secondary port(%pOFn), skipping...\n",
> + port);
> continue;
> }
>
> if (init_slave(gbe_dev, slave, port)) {
> dev_err(dev,
> - "Failed to initialize secondary port(%s), skipping...\n",
> - port->name);
> + "Failed to initialize secondary port(%pOFn), skipping...\n",
> + port);
> devm_kfree(dev, slave);
> continue;
> }
> @@ -3239,8 +3239,8 @@ static int set_xgbe_ethss10_priv(struct gbe_priv *gbe_dev,
> ret = of_address_to_resource(node, XGBE_SS_REG_INDEX, &res);
> if (ret) {
> dev_err(gbe_dev->dev,
> - "Can't xlate xgbe of node(%s) ss address at %d\n",
> - node->name, XGBE_SS_REG_INDEX);
> + "Can't xlate xgbe of node(%pOFn) ss address at %d\n",
> + node, XGBE_SS_REG_INDEX);
> return ret;
> }
>
> @@ -3254,8 +3254,8 @@ static int set_xgbe_ethss10_priv(struct gbe_priv *gbe_dev,
> ret = of_address_to_resource(node, XGBE_SM_REG_INDEX, &res);
> if (ret) {
> dev_err(gbe_dev->dev,
> - "Can't xlate xgbe of node(%s) sm address at %d\n",
> - node->name, XGBE_SM_REG_INDEX);
> + "Can't xlate xgbe of node(%pOFn) sm address at %d\n",
> + node, XGBE_SM_REG_INDEX);
> return ret;
> }
>
> @@ -3269,8 +3269,8 @@ static int set_xgbe_ethss10_priv(struct gbe_priv *gbe_dev,
> ret = of_address_to_resource(node, XGBE_SERDES_REG_INDEX, &res);
> if (ret) {
> dev_err(gbe_dev->dev,
> - "Can't xlate xgbe serdes of node(%s) address at %d\n",
> - node->name, XGBE_SERDES_REG_INDEX);
> + "Can't xlate xgbe serdes of node(%pOFn) address at %d\n",
> + node, XGBE_SERDES_REG_INDEX);
> return ret;
> }
>
> @@ -3347,8 +3347,8 @@ static int get_gbe_resource_version(struct gbe_priv *gbe_dev,
> ret = of_address_to_resource(node, GBE_SS_REG_INDEX, &res);
> if (ret) {
> dev_err(gbe_dev->dev,
> - "Can't translate of node(%s) of gbe ss address at %d\n",
> - node->name, GBE_SS_REG_INDEX);
> + "Can't translate of node(%pOFn) of gbe ss address at %d\n",
> + node, GBE_SS_REG_INDEX);
> return ret;
> }
>
> @@ -3372,8 +3372,8 @@ static int set_gbe_ethss14_priv(struct gbe_priv *gbe_dev,
> ret = of_address_to_resource(node, GBE_SGMII34_REG_INDEX, &res);
> if (ret) {
> dev_err(gbe_dev->dev,
> - "Can't translate of gbe node(%s) address at index %d\n",
> - node->name, GBE_SGMII34_REG_INDEX);
> + "Can't translate of gbe node(%pOFn) address at index %d\n",
> + node, GBE_SGMII34_REG_INDEX);
> return ret;
> }
>
> @@ -3388,8 +3388,8 @@ static int set_gbe_ethss14_priv(struct gbe_priv *gbe_dev,
> ret = of_address_to_resource(node, GBE_SM_REG_INDEX, &res);
> if (ret) {
> dev_err(gbe_dev->dev,
> - "Can't translate of gbe node(%s) address at index %d\n",
> - node->name, GBE_SM_REG_INDEX);
> + "Can't translate of gbe node(%pOFn) address at index %d\n",
> + node, GBE_SM_REG_INDEX);
> return ret;
> }
>
> @@ -3498,8 +3498,8 @@ static int set_gbenu_ethss_priv(struct gbe_priv *gbe_dev,
> ret = of_address_to_resource(node, GBENU_SM_REG_INDEX, &res);
> if (ret) {
> dev_err(gbe_dev->dev,
> - "Can't translate of gbenu node(%s) addr at index %d\n",
> - node->name, GBENU_SM_REG_INDEX);
> + "Can't translate of gbenu node(%pOFn) addr at index %d\n",
> + node, GBENU_SM_REG_INDEX);
> return ret;
> }
>
> @@ -3642,7 +3642,7 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
> ret = netcp_xgbe_serdes_init(gbe_dev->xgbe_serdes_regs,
> gbe_dev->ss_regs);
> } else {
> - dev_err(dev, "unknown GBE node(%s)\n", node->name);
> + dev_err(dev, "unknown GBE node(%pOFn)\n", node);
> ret = -ENODEV;
> }
>
> @@ -3667,8 +3667,8 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
> for_each_child_of_node(interfaces, interface) {
> ret = of_property_read_u32(interface, "slave-port", &slave_num);
> if (ret) {
> - dev_err(dev, "missing slave-port parameter, skipping interface configuration for %s\n",
> - interface->name);
> + dev_err(dev, "missing slave-port parameter, skipping interface configuration for %pOFn\n",
> + interface);
> continue;
> }
> gbe_dev->num_slaves++;
> --
> 2.17.1



2018-08-29 02:11:53

by MyungJoo Ham

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

> Dear Rob,
>
> On 2018ė…„ 08ģ›” 28ģ¼ 10:52, 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: Chanwoo Choi <[email protected]>
> > Cc: MyungJoo Ham <[email protected]>
> > Cc: Kyungmin Park <[email protected]>
> > Cc: Kukjin Kim <[email protected]>
> > Cc: Krzysztof Kozlowski <[email protected]>
> > Cc: [email protected]
> > Cc: [email protected]
> > Cc: [email protected]
> > Signed-off-by: Rob Herring <[email protected]>
> > ---
> > drivers/devfreq/event/exynos-ppmu.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
[]
>
> Acked-by: Chanwoo Choi <[email protected]>

Acked-by: MyungJoo Ham <[email protected]>



2018-08-29 02:14:59

by Sean Wang

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

On Mon, 2018-08-27 at 20:52 -0500, 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: Linus Walleij <[email protected]>
> Cc: Dong Aisheng <[email protected]>
> Cc: Fabio Estevam <[email protected]>
> Cc: Shawn Guo <[email protected]>
> Cc: Stefan Agner <[email protected]>
> Cc: Pengutronix Kernel Team <[email protected]>
> Cc: Sean Wang <[email protected]>
> Cc: Matthias Brugger <[email protected]>
> Cc: Carlo Caione <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Jason Cooper <[email protected]>
> Cc: Andrew Lunn <[email protected]>
> Cc: Gregory Clement <[email protected]>
> Cc: Sebastian Hesselbarth <[email protected]>
> Cc: Jean-Christophe Plagniol-Villard <[email protected]>
> Cc: Nicolas Ferre <[email protected]>
> Cc: Alexandre Belloni <[email protected]>
> Cc: Heiko Stuebner <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: Haojian Zhuang <[email protected]>
> Cc: Patrice Chotard <[email protected]>
> Cc: Barry Song <[email protected]>
> Cc: Maxime Coquelin <[email protected]>
> Cc: Alexandre Torgue <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: Chen-Yu Tsai <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/pinctrl/berlin/berlin.c | 6 ++--
> drivers/pinctrl/freescale/pinctrl-imx.c | 7 ++--
> drivers/pinctrl/freescale/pinctrl-imx1-core.c | 12 +++----
> drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 +--

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



2018-08-29 02:17:04

by Chen-Yu Tsai

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

On Tue, Aug 28, 2018 at 9:55 AM 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: Linus Walleij <[email protected]>
> Cc: Dong Aisheng <[email protected]>
> Cc: Fabio Estevam <[email protected]>
> Cc: Shawn Guo <[email protected]>
> Cc: Stefan Agner <[email protected]>
> Cc: Pengutronix Kernel Team <[email protected]>
> Cc: Sean Wang <[email protected]>
> Cc: Matthias Brugger <[email protected]>
> Cc: Carlo Caione <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Jason Cooper <[email protected]>
> Cc: Andrew Lunn <[email protected]>
> Cc: Gregory Clement <[email protected]>
> Cc: Sebastian Hesselbarth <[email protected]>
> Cc: Jean-Christophe Plagniol-Villard <[email protected]>
> Cc: Nicolas Ferre <[email protected]>
> Cc: Alexandre Belloni <[email protected]>
> Cc: Heiko Stuebner <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: Haojian Zhuang <[email protected]>
> Cc: Patrice Chotard <[email protected]>
> Cc: Barry Song <[email protected]>
> Cc: Maxime Coquelin <[email protected]>
> Cc: Alexandre Torgue <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: Chen-Yu Tsai <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/pinctrl/berlin/berlin.c | 6 ++--
> drivers/pinctrl/freescale/pinctrl-imx.c | 7 ++--
> drivers/pinctrl/freescale/pinctrl-imx1-core.c | 12 +++----
> drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 +--
> drivers/pinctrl/meson/pinctrl-meson.c | 2 +-
> drivers/pinctrl/mvebu/pinctrl-mvebu.c | 4 +--
> drivers/pinctrl/nomadik/pinctrl-nomadik.c | 6 ++--
> drivers/pinctrl/pinctrl-at91.c | 8 ++---
> drivers/pinctrl/pinctrl-lantiq.c | 8 ++---
> drivers/pinctrl/pinctrl-rockchip.c | 8 ++---
> drivers/pinctrl/pinctrl-rza1.c | 8 ++---
> drivers/pinctrl/pinctrl-single.c | 32 +++++++++----------
> drivers/pinctrl/pinctrl-st.c | 6 ++--
> drivers/pinctrl/sirf/pinctrl-atlas7.c | 4 +--
> drivers/pinctrl/stm32/pinctrl-stm32.c | 4 +--
> drivers/pinctrl/sunxi/pinctrl-sunxi.c | 8 ++---

For sunxi:

Acked-by: Chen-Yu Tsai <[email protected]>

2018-08-29 07:46:39

by Krzysztof Kozlowski

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

On Tue, 28 Aug 2018 at 03:54, 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: Roger Quadros <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: Kukjin Kim <[email protected]>
> Cc: Krzysztof Kozlowski <[email protected]>
> Cc: Thierry Reding <[email protected]>
> Cc: Jonathan Hunter <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/memory/omap-gpmc.c | 18 +++++++-----------
> drivers/memory/samsung/exynos-srom.c | 4 ++--

For Samsung:
Acked-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2018-08-29 07:48:50

by Krzysztof Kozlowski

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

On Tue, 28 Aug 2018 at 03:55, 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: Liam Girdwood <[email protected]>
> Cc: Mark Brown <[email protected]>
> Cc: Sangbeom Kim <[email protected]>
> Cc: Krzysztof Kozlowski <[email protected]>
> Cc: Bartlomiej Zolnierkiewicz <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/regulator/max8997-regulator.c | 4 +-
> drivers/regulator/mc13xxx-regulator-core.c | 2 +-
> drivers/regulator/of_regulator.c | 44 +++++++++++-----------
> drivers/regulator/qcom-rpmh-regulator.c | 14 +++----
> drivers/regulator/s5m8767.c | 12 +++---

For S5M8767:
Acked-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2018-08-29 08:23:43

by Heiko Stuebner

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

Am Dienstag, 28. August 2018, 03:52:44 CEST schrieb Rob Herring:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.

> drivers/soc/rockchip/pm_domains.c | 44 +++++++++++++++----------------

For the Rockchip-part
Acked-by: Heiko Stuebner <[email protected]>



2018-08-29 08:33:46

by Heiko Stuebner

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

Am Dienstag, 28. August 2018, 03:52:41 CEST schrieb Rob Herring:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.

> drivers/pinctrl/pinctrl-rockchip.c | 8 ++---

For the Rockchip-part
Acked-by: Heiko Stuebner <[email protected]>



2018-08-29 08:59:12

by Zhao Qiang

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

From: Rob Herring <[email protected]>
Date: 2018??8??28?? 9:53
> To: [email protected]
> Cc: Qiang Zhao <[email protected]>; Leo Li <[email protected]>; Andy
> Gross <[email protected]>; David Brown <[email protected]>; Heiko
> Stuebner <[email protected]>; Thierry Reding <[email protected]>;
> Jonathan Hunter <[email protected]>; Santosh Shilimkar
> <[email protected]>; [email protected];
> [email protected]; [email protected]
> Subject: [PATCH] soc: 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: Qiang Zhao <[email protected]>
> Cc: Li Yang <[email protected]>
> Cc: Andy Gross <[email protected]>
> Cc: David Brown <[email protected]>
> Cc: Heiko Stuebner <[email protected]>
> Cc: Thierry Reding <[email protected]>
> Cc: Jonathan Hunter <[email protected]>
> Cc: Santosh Shilimkar <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/soc/dove/pmu.c | 8 +++---
> drivers/soc/fsl/qe/qe_tdm.c | 4 +--
> drivers/soc/qcom/apr.c | 2 +-
> drivers/soc/rockchip/pm_domains.c | 44 +++++++++++++++----------------
> drivers/soc/tegra/pmc.c | 12 ++++-----
> drivers/soc/ti/knav_dma.c | 8 +++---
> drivers/soc/ti/knav_qmss_queue.c | 8 +++---
> 7 files changed, 43 insertions(+), 43 deletions(-)

For qe_tdm part
Acked-by: Qiang Zhao <[email protected]>

2018-08-29 11:15:21

by Rob Herring (Arm)

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

On Tue, Aug 28, 2018 at 5:15 PM Stephen Boyd <[email protected]> wrote:
>
> Quoting Rob Herring (2018-08-28 08:44:29)
> > In preparation to remove the node name pointer from struct device_node,
> > convert printf users to use the %pOFn format specifier.
> >
> > Cc: Eugeniy Paltsev <[email protected]>
> > Cc: Michael Turquette <[email protected]>
> > Cc: Stephen Boyd <[email protected]>
> > Cc: [email protected]
> > Cc: [email protected]
> > Cc: [email protected]
> > Cc: [email protected]
> > Signed-off-by: Rob Herring <[email protected]>
> > ---
>
> Reviewed-by: Stephen Boyd <[email protected]>

Please apply to the clock tree. There's no dependencies and removing
name will take some time.

Rob

2018-08-29 12:03:45

by Linus Walleij

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

On Tue, Aug 28, 2018 at 3:53 AM 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: Linus Walleij <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Patch applied.

Yours,
Linus Walleij

2018-08-29 12:08:48

by Linus Walleij

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

On Tue, Aug 28, 2018 at 3:55 AM 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: Linus Walleij <[email protected]>

Patch applied along with the thundering hoard of ACKs.

Yours,
Linus Walleij

2018-08-29 15:24:59

by Daniel Lezcano

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

On 28/08/2018 03:52, 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: Daniel Lezcano <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Michal Simek <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---

Applied for 4.20

Thanks!

-- Daniel


--
<http://www.linaro.org/> Linaro.org ā”‚ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


2018-08-29 18:44:25

by Rob Herring (Arm)

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

On Wed, Aug 29, 2018 at 1:03 PM Peter Rosin <[email protected]> wrote:
>
> On 2018-08-28 03:52, 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: Benjamin Herrenschmidt <[email protected]>
> > Cc: Paul Mackerras <[email protected]>
> > Cc: Michael Ellerman <[email protected]>
> > Cc: Peter Rosin <[email protected]>
> > Cc: [email protected]
> > Cc: [email protected]
> > Signed-off-by: Rob Herring <[email protected]>
> > ---
> > drivers/i2c/busses/i2c-powermac.c | 15 ++++++++-------
> > drivers/i2c/muxes/i2c-mux-gpmux.c | 4 ++--
> > 2 files changed, 10 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
> > index f2a2067525ef..b706fd136ca5 100644
> > --- a/drivers/i2c/busses/i2c-powermac.c
> > +++ b/drivers/i2c/busses/i2c-powermac.c
> > @@ -390,7 +390,6 @@ static int i2c_powermac_probe(struct platform_device *dev)
> > struct pmac_i2c_bus *bus = dev_get_platdata(&dev->dev);
> > struct device_node *parent = NULL;
>
> Lose the initializer...

That's pretty much unrelated though. I'd have to write "Also, remove
the unnecessary parent pointer init" in the commit message and we all
know "Also" is a clue for belongs in a separate patch.

Rob

2018-08-29 19:56:17

by Peter Rosin

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

On 2018-08-29 20:42, Rob Herring wrote:
> On Wed, Aug 29, 2018 at 1:03 PM Peter Rosin <[email protected]> wrote:
>>
>> On 2018-08-28 03:52, 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: Benjamin Herrenschmidt <[email protected]>
>>> Cc: Paul Mackerras <[email protected]>
>>> Cc: Michael Ellerman <[email protected]>
>>> Cc: Peter Rosin <[email protected]>
>>> Cc: [email protected]
>>> Cc: [email protected]
>>> Signed-off-by: Rob Herring <[email protected]>
>>> ---
>>> drivers/i2c/busses/i2c-powermac.c | 15 ++++++++-------
>>> drivers/i2c/muxes/i2c-mux-gpmux.c | 4 ++--
>>> 2 files changed, 10 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
>>> index f2a2067525ef..b706fd136ca5 100644
>>> --- a/drivers/i2c/busses/i2c-powermac.c
>>> +++ b/drivers/i2c/busses/i2c-powermac.c
>>> @@ -390,7 +390,6 @@ static int i2c_powermac_probe(struct platform_device *dev)
>>> struct pmac_i2c_bus *bus = dev_get_platdata(&dev->dev);
>>> struct device_node *parent = NULL;
>>
>> Lose the initializer...
>
> That's pretty much unrelated though.

I disagree. If you remove the need for the initializer, it's very much
related to also remove the initializer.

> I'd have to write "Also, remove
> the unnecessary parent pointer init" in the commit message and we all
> know "Also" is a clue for belongs in a separate patch.

How about: "This makes the parent pointer initializer redundant, lose it."

See, no "Also" in there, and no separate patch needed. Or don't mention it
at all.

Cheers,
Peter

2018-08-30 00:51:17

by Rob Herring (Arm)

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

On Wed, Aug 29, 2018 at 7:25 PM Peter Rosin <[email protected]> wrote:
>
> On 2018-08-29 20:42, Rob Herring wrote:
> > On Wed, Aug 29, 2018 at 1:03 PM Peter Rosin <[email protected]> wrote:
> >>
> >> On 2018-08-28 03:52, 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: Benjamin Herrenschmidt <[email protected]>
> >>> Cc: Paul Mackerras <[email protected]>
> >>> Cc: Michael Ellerman <[email protected]>
> >>> Cc: Peter Rosin <[email protected]>
> >>> Cc: [email protected]
> >>> Cc: [email protected]
> >>> Signed-off-by: Rob Herring <[email protected]>
> >>> ---
> >>> drivers/i2c/busses/i2c-powermac.c | 15 ++++++++-------
> >>> drivers/i2c/muxes/i2c-mux-gpmux.c | 4 ++--
> >>> 2 files changed, 10 insertions(+), 9 deletions(-)
> >>>
> >>> diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
> >>> index f2a2067525ef..b706fd136ca5 100644
> >>> --- a/drivers/i2c/busses/i2c-powermac.c
> >>> +++ b/drivers/i2c/busses/i2c-powermac.c
> >>> @@ -390,7 +390,6 @@ static int i2c_powermac_probe(struct platform_device *dev)
> >>> struct pmac_i2c_bus *bus = dev_get_platdata(&dev->dev);
> >>> struct device_node *parent = NULL;
> >>
> >> Lose the initializer...
> >
> > That's pretty much unrelated though.
>
> I disagree. If you remove the need for the initializer, it's very much
> related to also remove the initializer.

You're right. I'd stared at it a bit and missed that in fact parent is
only accessed within the case statement.

Rob

2018-08-30 02:43:41

by David Miller

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

From: Rob Herring <[email protected]>
Date: Tue, 28 Aug 2018 10:44:30 -0500

> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
>
> Signed-off-by: Rob Herring <[email protected]>
> ---
> v2:
> - fix missing brackets in netcp

Applied to net-next.

2018-08-30 14:39:28

by Simon Horman

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

On Tue, Aug 28, 2018 at 09:24:20AM +0200, Geert Uytterhoeven wrote:
> On Tue, Aug 28, 2018 at 3:54 AM 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: Simon Horman <[email protected]>
> > Cc: Magnus Damm <[email protected]>
> > Cc: [email protected]
> > Cc: [email protected]
> > Signed-off-by: Rob Herring <[email protected]>
>
> Reviewed-by: Geert Uytterhoeven <[email protected]>

Thanks Rob, thanks Geert, applied for v4.20.

2018-08-30 14:59:43

by Daniel Lezcano

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

On 28/08/2018 03:52, 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: Zhang Rui <[email protected]>
> Cc: Eduardo Valentin <[email protected]>
> Cc: Daniel Lezcano <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---

Acked-by: Daniel Lezcano <[email protected]>

> drivers/thermal/of-thermal.c | 10 +++++-----
> drivers/thermal/qoriq_thermal.c | 4 ++--
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
> index 977a8307fbb1..e201ae1c382f 100644
> --- a/drivers/thermal/of-thermal.c
> +++ b/drivers/thermal/of-thermal.c
> @@ -483,8 +483,8 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data,
> if (sensor_specs.args_count >= 1) {
> id = sensor_specs.args[0];
> WARN(sensor_specs.args_count > 1,
> - "%s: too many cells in sensor specifier %d\n",
> - sensor_specs.np->name, sensor_specs.args_count);
> + "%pOFn: too many cells in sensor specifier %d\n",
> + sensor_specs.np, sensor_specs.args_count);
> } else {
> id = 0;
> }
> @@ -960,8 +960,8 @@ int __init of_parse_thermal_zones(void)
>
> tz = thermal_of_build_thermal_zone(child);
> if (IS_ERR(tz)) {
> - pr_err("failed to build thermal zone %s: %ld\n",
> - child->name,
> + pr_err("failed to build thermal zone %pOFn: %ld\n",
> + child,
> PTR_ERR(tz));
> continue;
> }
> @@ -995,7 +995,7 @@ int __init of_parse_thermal_zones(void)
> tz->passive_delay,
> tz->polling_delay);
> if (IS_ERR(zone)) {
> - pr_err("Failed to build %s zone %ld\n", child->name,
> + pr_err("Failed to build %pOFn zone %ld\n", child,
> PTR_ERR(zone));
> kfree(tzp);
> kfree(ops);
> diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
> index c866cc165960..1fa132fc316b 100644
> --- a/drivers/thermal/qoriq_thermal.c
> +++ b/drivers/thermal/qoriq_thermal.c
> @@ -129,8 +129,8 @@ static int qoriq_tmu_get_sensor_id(void)
> if (sensor_specs.args_count >= 1) {
> id = sensor_specs.args[0];
> WARN(sensor_specs.args_count > 1,
> - "%s: too many cells in sensor specifier %d\n",
> - sensor_specs.np->name, sensor_specs.args_count);
> + "%pOFn: too many cells in sensor specifier %d\n",
> + sensor_specs.np, sensor_specs.args_count);
> } else {
> id = 0;
> }
>


--
<http://www.linaro.org/> Linaro.org ā”‚ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


2018-08-30 16:52:26

by Stephen Boyd

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

Quoting Rob Herring (2018-08-29 04:13:44)
> On Tue, Aug 28, 2018 at 5:15 PM Stephen Boyd <[email protected]> wrote:
> >
> > Quoting Rob Herring (2018-08-28 08:44:29)
> > > In preparation to remove the node name pointer from struct device_node,
> > > convert printf users to use the %pOFn format specifier.
> > >
> > > Cc: Eugeniy Paltsev <[email protected]>
> > > Cc: Michael Turquette <[email protected]>
> > > Cc: Stephen Boyd <[email protected]>
> > > Cc: [email protected]
> > > Cc: [email protected]
> > > Cc: [email protected]
> > > Cc: [email protected]
> > > Signed-off-by: Rob Herring <[email protected]>
> > > ---
> >
> > Reviewed-by: Stephen Boyd <[email protected]>
>
> Please apply to the clock tree. There's no dependencies and removing
> name will take some time.
>

Alright. Applied to clk-next. Thanks!


2018-09-02 17:57:17

by Jonathan Cameron

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

On Mon, 27 Aug 2018 20:52:23 -0500
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: Jonathan Cameron <[email protected]>
> Cc: Hartmut Knaack <[email protected]>
> Cc: Lars-Peter Clausen <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan

> ---
> drivers/iio/adc/qcom-pm8xxx-xoadc.c | 4 ++--
> drivers/iio/adc/rcar-gyroadc.c | 12 ++++++------
> drivers/iio/frequency/adf4350.c | 2 +-
> 3 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/iio/adc/qcom-pm8xxx-xoadc.c b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
> index b093ecddf1a8..c30c002f1fef 100644
> --- a/drivers/iio/adc/qcom-pm8xxx-xoadc.c
> +++ b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
> @@ -708,8 +708,8 @@ static int pm8xxx_of_xlate(struct iio_dev *indio_dev,
> * mux.
> */
> if (iiospec->args_count != 2) {
> - dev_err(&indio_dev->dev, "wrong number of arguments for %s need 2 got %d\n",
> - iiospec->np->name,
> + dev_err(&indio_dev->dev, "wrong number of arguments for %pOFn need 2 got %d\n",
> + iiospec->np,
> iiospec->args_count);
> return -EINVAL;
> }
> diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c
> index dcb50172186f..4e982b51bcda 100644
> --- a/drivers/iio/adc/rcar-gyroadc.c
> +++ b/drivers/iio/adc/rcar-gyroadc.c
> @@ -343,8 +343,8 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
> for_each_child_of_node(np, child) {
> of_id = of_match_node(rcar_gyroadc_child_match, child);
> if (!of_id) {
> - dev_err(dev, "Ignoring unsupported ADC \"%s\".",
> - child->name);
> + dev_err(dev, "Ignoring unsupported ADC \"%pOFn\".",
> + child);
> continue;
> }
>
> @@ -381,16 +381,16 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
> ret = of_property_read_u32(child, "reg", &reg);
> if (ret) {
> dev_err(dev,
> - "Failed to get child reg property of ADC \"%s\".\n",
> - child->name);
> + "Failed to get child reg property of ADC \"%pOFn\".\n",
> + child);
> return ret;
> }
>
> /* Channel number is too high. */
> if (reg >= num_channels) {
> dev_err(dev,
> - "Only %i channels supported with %s, but reg = <%i>.\n",
> - num_channels, child->name, reg);
> + "Only %i channels supported with %pOFn, but reg = <%i>.\n",
> + num_channels, child, reg);
> return ret;
> }
> }
> diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
> index 6d768431d90e..f4748ff243f7 100644
> --- a/drivers/iio/frequency/adf4350.c
> +++ b/drivers/iio/frequency/adf4350.c
> @@ -388,7 +388,7 @@ static struct adf4350_platform_data *adf4350_parse_dt(struct device *dev)
> if (!pdata)
> return NULL;
>
> - strncpy(&pdata->name[0], np->name, SPI_NAME_SIZE - 1);
> + snprintf(&pdata->name[0], SPI_NAME_SIZE - 1, "%pOFn", np);
>
> tmp = 10000;
> of_property_read_u32(np, "adi,channel-spacing", &tmp);


2018-09-03 05:31:23

by Chen-Yu Tsai

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

On Tue, Aug 28, 2018 at 9:53 AM 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: Eugeniy Paltsev <[email protected]>
> Cc: Michael Turquette <[email protected]>
> Cc: Stephen Boyd <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---

> drivers/clk/sunxi/clk-mod0.c | 6 +++---
> drivers/clk/sunxi/clk-sun9i-core.c | 20 ++++++++++----------
> drivers/clk/sunxi/clk-sunxi.c | 4 ++--

For the sunxi bits,

Acked-by: Chen-Yu Tsai <[email protected]>

2018-09-03 06:36:13

by Viresh Kumar

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

On 27-08-18, 20:52, 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: "Rafael J. Wysocki" <[email protected]>
> Cc: Viresh Kumar <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/cpufreq/s5pv210-cpufreq.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
> index 5d31c2db12a3..dbecd7667db2 100644
> --- a/drivers/cpufreq/s5pv210-cpufreq.c
> +++ b/drivers/cpufreq/s5pv210-cpufreq.c
> @@ -611,8 +611,8 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
> for_each_compatible_node(np, NULL, "samsung,s5pv210-dmc") {
> id = of_alias_get_id(np, "dmc");
> if (id < 0 || id >= ARRAY_SIZE(dmc_base)) {
> - pr_err("%s: failed to get alias of dmc node '%s'\n",
> - __func__, np->name);
> + pr_err("%s: failed to get alias of dmc node '%pOFn'\n",
> + __func__, np);
> of_node_put(np);
> return id;
> }

Acked-by: Viresh Kumar <[email protected]>

--
viresh

2018-09-03 10:00:11

by Patrice CHOTARD

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

Hi Rob

On 08/28/2018 03:52 AM, 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: Linus Walleij <[email protected]>
> Cc: Dong Aisheng <[email protected]>
> Cc: Fabio Estevam <[email protected]>
> Cc: Shawn Guo <[email protected]>
> Cc: Stefan Agner <[email protected]>
> Cc: Pengutronix Kernel Team <[email protected]>
> Cc: Sean Wang <[email protected]>
> Cc: Matthias Brugger <[email protected]>
> Cc: Carlo Caione <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Jason Cooper <[email protected]>
> Cc: Andrew Lunn <[email protected]>
> Cc: Gregory Clement <[email protected]>
> Cc: Sebastian Hesselbarth <[email protected]>
> Cc: Jean-Christophe Plagniol-Villard <[email protected]>
> Cc: Nicolas Ferre <[email protected]>
> Cc: Alexandre Belloni <[email protected]>
> Cc: Heiko Stuebner <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: Haojian Zhuang <[email protected]>
> Cc: Patrice Chotard <[email protected]>
> Cc: Barry Song <[email protected]>
> Cc: Maxime Coquelin <[email protected]>
> Cc: Alexandre Torgue <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: Chen-Yu Tsai <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/pinctrl/berlin/berlin.c | 6 ++--
> drivers/pinctrl/freescale/pinctrl-imx.c | 7 ++--
> drivers/pinctrl/freescale/pinctrl-imx1-core.c | 12 +++----
> drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 +--
> drivers/pinctrl/meson/pinctrl-meson.c | 2 +-
> drivers/pinctrl/mvebu/pinctrl-mvebu.c | 4 +--
> drivers/pinctrl/nomadik/pinctrl-nomadik.c | 6 ++--
> drivers/pinctrl/pinctrl-at91.c | 8 ++---
> drivers/pinctrl/pinctrl-lantiq.c | 8 ++---
> drivers/pinctrl/pinctrl-rockchip.c | 8 ++---
> drivers/pinctrl/pinctrl-rza1.c | 8 ++---
> drivers/pinctrl/pinctrl-single.c | 32 +++++++++----------
> drivers/pinctrl/pinctrl-st.c | 6 ++--
> drivers/pinctrl/sirf/pinctrl-atlas7.c | 4 +--
> drivers/pinctrl/stm32/pinctrl-stm32.c | 4 +--
> drivers/pinctrl/sunxi/pinctrl-sunxi.c | 8 ++---
> drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 8 ++---
> 17 files changed, 66 insertions(+), 69 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
> index 0966bb0bf71f..e66af93f2cbf 100644
> --- a/drivers/pinctrl/pinctrl-st.c
> +++ b/drivers/pinctrl/pinctrl-st.c
> @@ -817,8 +817,8 @@ static int st_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
>
> grp = st_pctl_find_group_by_name(info, np->name);
> if (!grp) {
> - dev_err(info->dev, "unable to find group for node %s\n",
> - np->name);
> + dev_err(info->dev, "unable to find group for node %pOFn\n",
> + np);
> return -EINVAL;
> }
>
> @@ -1184,7 +1184,7 @@ static int st_pctl_dt_parse_groups(struct device_node *np,
> if (pp->length / sizeof(__be32) >= OF_GPIO_ARGS_MIN) {
> npins++;
> } else {
> - pr_warn("Invalid st,pins in %s node\n", np->name);
> + pr_warn("Invalid st,pins in %pOFn node\n", np);
> return -EINVAL;
> }
> }

For pinctrl-st:

Acked-by: Patrice Chotard <[email protected]>

Thanks
Patrice

2018-09-03 17:00:43

by Kalle Valo

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

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: Kalle Valo <[email protected]>
> Cc: "David S. Miller" <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

e12e643c1dfb ath6kl: convert to using %pOFn instead of device_node.name

--
https://patchwork.kernel.org/patch/10577811/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


2018-09-03 21:47:10

by Takashi Iwai

[permalink] [raw]
Subject: Re: [alsa-devel] [PATCH v2] sound: Convert to using %pOFn instead of device_node.name

On Tue, 28 Aug 2018 17:44:31 +0200,
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: Johannes Berg <[email protected]>
> Cc: Jaroslav Kysela <[email protected]>
> Cc: Takashi Iwai <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Applied now, thanks.


Takashi

2018-09-04 02:26:22

by Kishon Vijay Abraham I

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

Hi Rob,

On Tuesday 28 August 2018 07:22 AM, Rob Herring wrote:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.

I assume it should be okay to get this merged in the next merge window?

Thanks
Kishon
>
> Cc: Kishon Vijay Abraham I <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/phy/broadcom/phy-bcm-cygnus-pcie.c | 4 ++--
> drivers/phy/broadcom/phy-brcm-sata.c | 4 ++--
> drivers/phy/marvell/phy-berlin-sata.c | 6 +++---
> drivers/phy/qualcomm/phy-qcom-qmp.c | 2 +-
> drivers/phy/rockchip/phy-rockchip-emmc.c | 4 ++--
> drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 8 ++++----
> drivers/phy/rockchip/phy-rockchip-typec.c | 8 ++++----
> drivers/phy/rockchip/phy-rockchip-usb.c | 4 ++--
> drivers/phy/tegra/xusb.c | 4 ++--
> 9 files changed, 22 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/phy/broadcom/phy-bcm-cygnus-pcie.c b/drivers/phy/broadcom/phy-bcm-cygnus-pcie.c
> index 0f4ac5d63cff..b074682d9dd8 100644
> --- a/drivers/phy/broadcom/phy-bcm-cygnus-pcie.c
> +++ b/drivers/phy/broadcom/phy-bcm-cygnus-pcie.c
> @@ -153,8 +153,8 @@ static int cygnus_pcie_phy_probe(struct platform_device *pdev)
> struct cygnus_pcie_phy *p;
>
> if (of_property_read_u32(child, "reg", &id)) {
> - dev_err(dev, "missing reg property for %s\n",
> - child->name);
> + dev_err(dev, "missing reg property for %pOFn\n",
> + child);
> ret = -EINVAL;
> goto put_child;
> }
> diff --git a/drivers/phy/broadcom/phy-brcm-sata.c b/drivers/phy/broadcom/phy-brcm-sata.c
> index 8708ea3b4d6d..ac57f5a41708 100644
> --- a/drivers/phy/broadcom/phy-brcm-sata.c
> +++ b/drivers/phy/broadcom/phy-brcm-sata.c
> @@ -600,8 +600,8 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)
> struct brcm_sata_port *port;
>
> if (of_property_read_u32(child, "reg", &id)) {
> - dev_err(dev, "missing reg property in node %s\n",
> - child->name);
> + dev_err(dev, "missing reg property in node %pOFn\n",
> + child);
> ret = -EINVAL;
> goto put_child;
> }
> diff --git a/drivers/phy/marvell/phy-berlin-sata.c b/drivers/phy/marvell/phy-berlin-sata.c
> index c1bb6725e48f..a91fc67fc4e0 100644
> --- a/drivers/phy/marvell/phy-berlin-sata.c
> +++ b/drivers/phy/marvell/phy-berlin-sata.c
> @@ -231,14 +231,14 @@ static int phy_berlin_sata_probe(struct platform_device *pdev)
> struct phy_berlin_desc *phy_desc;
>
> if (of_property_read_u32(child, "reg", &phy_id)) {
> - dev_err(dev, "missing reg property in node %s\n",
> - child->name);
> + dev_err(dev, "missing reg property in node %pOFn\n",
> + child);
> ret = -EINVAL;
> goto put_child;
> }
>
> if (phy_id >= ARRAY_SIZE(phy_berlin_power_down_bits)) {
> - dev_err(dev, "invalid reg in node %s\n", child->name);
> + dev_err(dev, "invalid reg in node %pOFn\n", child);
> ret = -EINVAL;
> goto put_child;
> }
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c
> index 4c470104a0d6..baa59484a90c 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
> @@ -1400,7 +1400,7 @@ static int phy_pipe_clk_register(struct qcom_qmp *qmp, struct device_node *np)
>
> ret = of_property_read_string(np, "clock-output-names", &init.name);
> if (ret) {
> - dev_err(qmp->dev, "%s: No clock-output-names\n", np->name);
> + dev_err(qmp->dev, "%pOFn: No clock-output-names\n", np);
> return ret;
> }
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-emmc.c b/drivers/phy/rockchip/phy-rockchip-emmc.c
> index b237360f95f6..19bf84f0bc67 100644
> --- a/drivers/phy/rockchip/phy-rockchip-emmc.c
> +++ b/drivers/phy/rockchip/phy-rockchip-emmc.c
> @@ -337,8 +337,8 @@ static int rockchip_emmc_phy_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> if (of_property_read_u32(dev->of_node, "reg", &reg_offset)) {
> - dev_err(dev, "missing reg property in node %s\n",
> - dev->of_node->name);
> + dev_err(dev, "missing reg property in node %pOFn\n",
> + dev->of_node);
> return -EINVAL;
> }
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index 5049dac79bd0..24bd2717abdb 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> @@ -1116,8 +1116,8 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev)
> }
>
> if (of_property_read_u32(np, "reg", &reg)) {
> - dev_err(dev, "the reg property is not assigned in %s node\n",
> - np->name);
> + dev_err(dev, "the reg property is not assigned in %pOFn node\n",
> + np);
> return -EINVAL;
> }
>
> @@ -1143,8 +1143,8 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev)
> }
>
> if (!rphy->phy_cfg) {
> - dev_err(dev, "no phy-config can be matched with %s node\n",
> - np->name);
> + dev_err(dev, "no phy-config can be matched with %pOFn node\n",
> + np);
> return -EINVAL;
> }
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
> index 76a4b58ec771..c57e496f0b0c 100644
> --- a/drivers/phy/rockchip/phy-rockchip-typec.c
> +++ b/drivers/phy/rockchip/phy-rockchip-typec.c
> @@ -1145,8 +1145,8 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
> }
>
> if (!tcphy->port_cfgs) {
> - dev_err(dev, "no phy-config can be matched with %s node\n",
> - np->name);
> + dev_err(dev, "no phy-config can be matched with %pOFn node\n",
> + np);
> return -EINVAL;
> }
>
> @@ -1186,8 +1186,8 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
> continue;
>
> if (IS_ERR(phy)) {
> - dev_err(dev, "failed to create phy: %s\n",
> - child_np->name);
> + dev_err(dev, "failed to create phy: %pOFn\n",
> + child_np);
> pm_runtime_disable(dev);
> return PTR_ERR(phy);
> }
> diff --git a/drivers/phy/rockchip/phy-rockchip-usb.c b/drivers/phy/rockchip/phy-rockchip-usb.c
> index 3378eeb7a562..269c86329cb8 100644
> --- a/drivers/phy/rockchip/phy-rockchip-usb.c
> +++ b/drivers/phy/rockchip/phy-rockchip-usb.c
> @@ -208,8 +208,8 @@ static int rockchip_usb_phy_init(struct rockchip_usb_phy_base *base,
> rk_phy->np = child;
>
> if (of_property_read_u32(child, "reg", &reg_offset)) {
> - dev_err(base->dev, "missing reg property in node %s\n",
> - child->name);
> + dev_err(base->dev, "missing reg property in node %pOFn\n",
> + child);
> return -EINVAL;
> }
>
> diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
> index de1b4ebe4de2..5b3b8863363e 100644
> --- a/drivers/phy/tegra/xusb.c
> +++ b/drivers/phy/tegra/xusb.c
> @@ -115,8 +115,8 @@ int tegra_xusb_lane_parse_dt(struct tegra_xusb_lane *lane,
>
> err = match_string(lane->soc->funcs, lane->soc->num_funcs, function);
> if (err < 0) {
> - dev_err(dev, "invalid function \"%s\" for lane \"%s\"\n",
> - function, np->name);
> + dev_err(dev, "invalid function \"%s\" for lane \"%pOFn\"\n",
> + function, np);
> return err;
> }
>
>

2018-09-04 14:23:18

by Rob Herring (Arm)

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

On Mon, Sep 3, 2018 at 9:24 PM Kishon Vijay Abraham I <[email protected]> wrote:
>
> Hi Rob,
>
> On Tuesday 28 August 2018 07:22 AM, Rob Herring wrote:
> > In preparation to remove the node name pointer from struct device_node,
> > convert printf users to use the %pOFn format specifier.
>
> I assume it should be okay to get this merged in the next merge window?

Yes, of course.

Rob

2018-09-04 22:01:22

by Miquel Raynal

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

Hi Rob,

Rob Herring <[email protected]> wrote on Mon, 27 Aug 2018 20:52:34 -0500:

> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
>
> Cc: Boris Brezillon <[email protected]>
> Cc: Miquel Raynal <[email protected]>
> Cc: Richard Weinberger <[email protected]>
> Cc: David Woodhouse <[email protected]>
> Cc: Brian Norris <[email protected]>
> Cc: Marek Vasut <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---


Applied to nand/next.

Thanks,
MiquĆØl

2018-09-05 13:29:38

by Michal Simek

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

On 28.8.2018 03:52, 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: Michal Simek <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> arch/arm/mach-zynq/slcr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
> index f0292a30e6f6..10ef99ce1d90 100644
> --- a/arch/arm/mach-zynq/slcr.c
> +++ b/arch/arm/mach-zynq/slcr.c
> @@ -233,7 +233,7 @@ int __init zynq_early_slcr_init(void)
>
> register_restart_handler(&zynq_slcr_restart_nb);
>
> - pr_info("%s mapped to %p\n", np->name, zynq_slcr_base);
> + pr_info("%pOFn mapped to %p\n", np, zynq_slcr_base);
>
> of_node_put(np);
>
>

Applied.
M

2018-09-07 15:53:25

by Rob Herring (Arm)

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

On Mon, Aug 27, 2018 at 8:53 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.


> @@ -492,8 +492,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
>
> provider->base = of_iomap(node, 0);
>
> - provider->clkdm_name = kmalloc(strlen(node->parent->name) + 3,
> - GFP_KERNEL);
> + provider->clkdm_name = kasprintf(GFP_KERNEL, "%pOFnxxx", node->parent);

Turns out xxx was a bad choice as the %p handler eats all alphanumeric
characters. Looks like this has already been applied, so I will send a
fix.

Rob

2018-09-07 17:16:03

by Tony Lindgren

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

* Rob Herring <[email protected]> [180828 08:48]:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
>
> Cc: "BenoĆ®t Cousson" <[email protected]>
> Cc: Paul Walmsley <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> v2:
> - fix error in format specifier position

Thanks applying into omap-for-v4.20/soc.

Regards,

Tony

2018-09-08 12:16:49

by Thomas Gleixner

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

On Mon, 27 Aug 2018, 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: Thomas Gleixner <[email protected]>
> Cc: Jason Cooper <[email protected]>
> Cc: Marc Zyngier <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Should I take it or do you want to take it with others? If the latter,
acked-by-me.

Thanks,

tglx

2018-09-10 14:00:14

by Rob Herring (Arm)

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

On Sat, Sep 8, 2018 at 7:15 AM Thomas Gleixner <[email protected]> wrote:
>
> On Mon, 27 Aug 2018, 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: Thomas Gleixner <[email protected]>
> > Cc: Jason Cooper <[email protected]>
> > Cc: Marc Zyngier <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Rob Herring <[email protected]>
>
> Should I take it or do you want to take it with others? If the latter,
> acked-by-me.

Please take it. There's no dependency.

Rob

2018-09-10 15:25:47

by Lee Jones

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

On Mon, 27 Aug 2018, 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: Lee Jones <[email protected]>
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/mfd/max77620.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

--
Lee Jones [Ꝏē¼ę–Æ]
Linaro Services Technical Lead
Linaro.org ā”‚ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2018-09-12 15:12:45

by Mauro Carvalho Chehab

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

Em Tue, 28 Aug 2018 07:21:46 -0500
Rob Herring <[email protected]> escreveu:

> On Tue, Aug 28, 2018 at 5:06 AM Laurent Pinchart
> <[email protected]> wrote:
> >
> > Hi Rob,
> >
> > Thank you for the patch.
> >
> > On Tuesday, 28 August 2018 04:52:29 EEST 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: Mauro Carvalho Chehab <[email protected]>
> > > Cc: "Lad, Prabhakar" <[email protected]>
> > > Cc: Benoit Parrot <[email protected]>
> > > Cc: Philipp Zabel <[email protected]>
> > > Cc: Hyun Kwon <[email protected]>
> > > Cc: Laurent Pinchart <[email protected]>
> > > Cc: Michal Simek <[email protected]>
> > > Cc: [email protected]
> > > Signed-off-by: Rob Herring <[email protected]>
> >
> > Reviewed-by: Laurent Pinchart <[email protected]>
> >
> > Which tree would you like to merge this through ?
>
> Media tree. There's no dependency.

Ok. I'm applying it.

>
> Rob



Thanks,
Mauro

2018-09-12 15:19:32

by Mauro Carvalho Chehab

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

Em Tue, 28 Aug 2018 10:44:33 -0500
Rob Herring <[email protected]> escreveu:

> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
>
> Cc: Steve Longerbeam <[email protected]>
> Cc: Philipp Zabel <[email protected]>
> Cc: Mauro Carvalho Chehab <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> v2:
> - fix conditional use of node name vs devname for imx
>
> drivers/staging/media/imx/imx-media-dev.c | 15 ++++++++++-----
> drivers/staging/media/imx/imx-media-of.c | 4 ++--
> drivers/staging/mt7621-eth/mdio.c | 4 ++--

It would be better if you had submitted the staging/media stuff
on a separate patch, as they usually go via the media tree.

As I don't foresee any conflicts on that part of the code,
I'm Ok if Greg pick it and submit via his tree.

So,

Acked-by: Mauro Carvalho Chehab <[email protected]>

If you prefer instead that I would pick the media part, please
split it into two patches.

Regards,
Mauro

> 3 files changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c
> index b0be80f05767..3f48f5ceb6ea 100644
> --- a/drivers/staging/media/imx/imx-media-dev.c
> +++ b/drivers/staging/media/imx/imx-media-dev.c
> @@ -89,8 +89,12 @@ int imx_media_add_async_subdev(struct imx_media_dev *imxmd,
>
> /* return -EEXIST if this asd already added */
> if (find_async_subdev(imxmd, fwnode, devname)) {
> - dev_dbg(imxmd->md.dev, "%s: already added %s\n",
> - __func__, np ? np->name : devname);
> + if (np)
> + dev_dbg(imxmd->md.dev, "%s: already added %pOFn\n",
> + __func__, np);
> + else
> + dev_dbg(imxmd->md.dev, "%s: already added %s\n",
> + __func__, devname);
> ret = -EEXIST;
> goto out;
> }
> @@ -105,19 +109,20 @@ int imx_media_add_async_subdev(struct imx_media_dev *imxmd,
> if (fwnode) {
> asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
> asd->match.fwnode = fwnode;
> + dev_dbg(imxmd->md.dev, "%s: added %pOFn, match type FWNODE\n",
> + __func__, np);
> } else {
> asd->match_type = V4L2_ASYNC_MATCH_DEVNAME;
> asd->match.device_name = devname;
> imxasd->pdev = pdev;
> + dev_dbg(imxmd->md.dev, "%s: added %s, match type DEVNAME\n",
> + __func__, devname);
> }
>
> list_add_tail(&imxasd->list, &imxmd->asd_list);
>
> imxmd->subdev_notifier.num_subdevs++;
>
> - dev_dbg(imxmd->md.dev, "%s: added %s, match type %s\n",
> - __func__, np ? np->name : devname, np ? "FWNODE" : "DEVNAME");
> -
> out:
> mutex_unlock(&imxmd->mutex);
> return ret;
> diff --git a/drivers/staging/media/imx/imx-media-of.c b/drivers/staging/media/imx/imx-media-of.c
> index acde372c6795..163437e421c5 100644
> --- a/drivers/staging/media/imx/imx-media-of.c
> +++ b/drivers/staging/media/imx/imx-media-of.c
> @@ -79,8 +79,8 @@ of_parse_subdev(struct imx_media_dev *imxmd, struct device_node *sd_np,
> int i, num_ports, ret;
>
> if (!of_device_is_available(sd_np)) {
> - dev_dbg(imxmd->md.dev, "%s: %s not enabled\n", __func__,
> - sd_np->name);
> + dev_dbg(imxmd->md.dev, "%s: %pOFn not enabled\n", __func__,
> + sd_np);
> /* unavailable is not an error */
> return 0;
> }
> diff --git a/drivers/staging/mt7621-eth/mdio.c b/drivers/staging/mt7621-eth/mdio.c
> index 7ad0c4141205..9ffa8f771235 100644
> --- a/drivers/staging/mt7621-eth/mdio.c
> +++ b/drivers/staging/mt7621-eth/mdio.c
> @@ -70,7 +70,7 @@ int mtk_connect_phy_node(struct mtk_eth *eth, struct mtk_mac *mac,
> _port = of_get_property(phy_node, "reg", NULL);
>
> if (!_port || (be32_to_cpu(*_port) >= 0x20)) {
> - pr_err("%s: invalid port id\n", phy_node->name);
> + pr_err("%pOFn: invalid port id\n", phy_node);
> return -EINVAL;
> }
> port = be32_to_cpu(*_port);
> @@ -249,7 +249,7 @@ int mtk_mdio_init(struct mtk_eth *eth)
> eth->mii_bus->priv = eth;
> eth->mii_bus->parent = eth->dev;
>
> - snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%s", mii_np->name);
> + snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%pOFn", mii_np);
> err = of_mdiobus_register(eth->mii_bus, mii_np);
> if (err)
> goto err_free_bus;
> --
> 2.17.1



Thanks,
Mauro

2018-09-12 20:28:50

by Rob Herring (Arm)

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

+Joe P

On Wed, Sep 12, 2018 at 10:17 AM Mauro Carvalho Chehab
<[email protected]> wrote:
>
> Em Tue, 28 Aug 2018 10:44:33 -0500
> Rob Herring <[email protected]> escreveu:
>
> > In preparation to remove the node name pointer from struct device_node,
> > convert printf users to use the %pOFn format specifier.
> >
> > Cc: Steve Longerbeam <[email protected]>
> > Cc: Philipp Zabel <[email protected]>
> > Cc: Mauro Carvalho Chehab <[email protected]>
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: [email protected]
> > Cc: [email protected]
> > Signed-off-by: Rob Herring <[email protected]>
> > ---
> > v2:
> > - fix conditional use of node name vs devname for imx
> >
> > drivers/staging/media/imx/imx-media-dev.c | 15 ++++++++++-----
> > drivers/staging/media/imx/imx-media-of.c | 4 ++--
> > drivers/staging/mt7621-eth/mdio.c | 4 ++--
>
> It would be better if you had submitted the staging/media stuff
> on a separate patch, as they usually go via the media tree.

Sorry, I thought Greg took all of staging.

A problem with MAINTAINERS is there is no way to tell who applies
patches for a given path vs. anyone else listed. This frequently
happens when the maintainer organization doesn't match the directory
org. If we distinguished this, then it would be quite easy to see when
you've created a patch that needs to be split to different maintainers
(or an explanation why it isn't). Whatever happened with splitting up
MAINTAINERS? If there was a file for each maintainer tree, then it
would be easier to extract that information.

Or maybe we just need to be stricter with the 'M' vs. 'R' tag and 'M'
means that is the person who applies the patch. I don't think many
drivers have their own tree and maintainer except for a few big ones.

Rob

>
> As I don't foresee any conflicts on that part of the code,
> I'm Ok if Greg pick it and submit via his tree.
>
> So,
>
> Acked-by: Mauro Carvalho Chehab <[email protected]>
>
> If you prefer instead that I would pick the media part, please
> split it into two patches.
>
> Regards,
> Mauro
>
> > 3 files changed, 14 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c
> > index b0be80f05767..3f48f5ceb6ea 100644
> > --- a/drivers/staging/media/imx/imx-media-dev.c
> > +++ b/drivers/staging/media/imx/imx-media-dev.c
> > @@ -89,8 +89,12 @@ int imx_media_add_async_subdev(struct imx_media_dev *imxmd,
> >
> > /* return -EEXIST if this asd already added */
> > if (find_async_subdev(imxmd, fwnode, devname)) {
> > - dev_dbg(imxmd->md.dev, "%s: already added %s\n",
> > - __func__, np ? np->name : devname);
> > + if (np)
> > + dev_dbg(imxmd->md.dev, "%s: already added %pOFn\n",
> > + __func__, np);
> > + else
> > + dev_dbg(imxmd->md.dev, "%s: already added %s\n",
> > + __func__, devname);
> > ret = -EEXIST;
> > goto out;
> > }
> > @@ -105,19 +109,20 @@ int imx_media_add_async_subdev(struct imx_media_dev *imxmd,
> > if (fwnode) {
> > asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
> > asd->match.fwnode = fwnode;
> > + dev_dbg(imxmd->md.dev, "%s: added %pOFn, match type FWNODE\n",
> > + __func__, np);
> > } else {
> > asd->match_type = V4L2_ASYNC_MATCH_DEVNAME;
> > asd->match.device_name = devname;
> > imxasd->pdev = pdev;
> > + dev_dbg(imxmd->md.dev, "%s: added %s, match type DEVNAME\n",
> > + __func__, devname);
> > }
> >
> > list_add_tail(&imxasd->list, &imxmd->asd_list);
> >
> > imxmd->subdev_notifier.num_subdevs++;
> >
> > - dev_dbg(imxmd->md.dev, "%s: added %s, match type %s\n",
> > - __func__, np ? np->name : devname, np ? "FWNODE" : "DEVNAME");
> > -
> > out:
> > mutex_unlock(&imxmd->mutex);
> > return ret;
> > diff --git a/drivers/staging/media/imx/imx-media-of.c b/drivers/staging/media/imx/imx-media-of.c
> > index acde372c6795..163437e421c5 100644
> > --- a/drivers/staging/media/imx/imx-media-of.c
> > +++ b/drivers/staging/media/imx/imx-media-of.c
> > @@ -79,8 +79,8 @@ of_parse_subdev(struct imx_media_dev *imxmd, struct device_node *sd_np,
> > int i, num_ports, ret;
> >
> > if (!of_device_is_available(sd_np)) {
> > - dev_dbg(imxmd->md.dev, "%s: %s not enabled\n", __func__,
> > - sd_np->name);
> > + dev_dbg(imxmd->md.dev, "%s: %pOFn not enabled\n", __func__,
> > + sd_np);
> > /* unavailable is not an error */
> > return 0;
> > }
> > diff --git a/drivers/staging/mt7621-eth/mdio.c b/drivers/staging/mt7621-eth/mdio.c
> > index 7ad0c4141205..9ffa8f771235 100644
> > --- a/drivers/staging/mt7621-eth/mdio.c
> > +++ b/drivers/staging/mt7621-eth/mdio.c
> > @@ -70,7 +70,7 @@ int mtk_connect_phy_node(struct mtk_eth *eth, struct mtk_mac *mac,
> > _port = of_get_property(phy_node, "reg", NULL);
> >
> > if (!_port || (be32_to_cpu(*_port) >= 0x20)) {
> > - pr_err("%s: invalid port id\n", phy_node->name);
> > + pr_err("%pOFn: invalid port id\n", phy_node);
> > return -EINVAL;
> > }
> > port = be32_to_cpu(*_port);
> > @@ -249,7 +249,7 @@ int mtk_mdio_init(struct mtk_eth *eth)
> > eth->mii_bus->priv = eth;
> > eth->mii_bus->parent = eth->dev;
> >
> > - snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%s", mii_np->name);
> > + snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%pOFn", mii_np);
> > err = of_mdiobus_register(eth->mii_bus, mii_np);
> > if (err)
> > goto err_free_bus;
> > --
> > 2.17.1
>
>
>
> Thanks,
> Mauro

2018-09-12 21:08:25

by Mauro Carvalho Chehab

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

Em Wed, 12 Sep 2018 15:26:48 -0500
Rob Herring <[email protected]> escreveu:

> +Joe P
>
> On Wed, Sep 12, 2018 at 10:17 AM Mauro Carvalho Chehab
> <[email protected]> wrote:
> >
> > Em Tue, 28 Aug 2018 10:44:33 -0500
> > Rob Herring <[email protected]> escreveu:
> >
> > > In preparation to remove the node name pointer from struct device_node,
> > > convert printf users to use the %pOFn format specifier.
> > >
> > > Cc: Steve Longerbeam <[email protected]>
> > > Cc: Philipp Zabel <[email protected]>
> > > Cc: Mauro Carvalho Chehab <[email protected]>
> > > Cc: Greg Kroah-Hartman <[email protected]>
> > > Cc: [email protected]
> > > Cc: [email protected]
> > > Signed-off-by: Rob Herring <[email protected]>
> > > ---
> > > v2:
> > > - fix conditional use of node name vs devname for imx
> > >
> > > drivers/staging/media/imx/imx-media-dev.c | 15 ++++++++++-----
> > > drivers/staging/media/imx/imx-media-of.c | 4 ++--
> > > drivers/staging/mt7621-eth/mdio.c | 4 ++--
> >
> > It would be better if you had submitted the staging/media stuff
> > on a separate patch, as they usually go via the media tree.
>
> Sorry, I thought Greg took all of staging.

No, I usually take media patches on staging. It seems that at least
the IIO subsystem does the same:

IIO SUBSYSTEM AND DRIVERS
M: Jonathan Cameron <[email protected]>
R: Hartmut Knaack <[email protected]>
R: Lars-Peter Clausen <[email protected]>
R: Peter Meerwald-Stadler <[email protected]>
L: [email protected]
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
S: Maintained
F: Documentation/ABI/testing/configfs-iio*
F: Documentation/ABI/testing/sysfs-bus-iio*
F: Documentation/devicetree/bindings/iio/
F: drivers/iio/
F: drivers/staging/iio/
F: include/linux/iio/
F: tools/iio/

Anyway, as I said before, I don't have any issues if Greg takes
this specific patch.

> A problem with MAINTAINERS is there is no way to tell who applies
> patches for a given path vs. anyone else listed. This frequently
> happens when the maintainer organization doesn't match the directory
> org. If we distinguished this, then it would be quite easy to see when
> you've created a patch that needs to be split to different maintainers
> (or an explanation why it isn't). Whatever happened with splitting up
> MAINTAINERS? If there was a file for each maintainer tree, then it
> would be easier to extract that information.

Yes, but, on the other hand, get_maintainers.pl would likely
take more time to process, if a patch touches multiple subsystems.

>
> Or maybe we just need to be stricter with the 'M' vs. 'R' tag and 'M'
> means that is the person who applies the patch. I don't think many
> drivers have their own tree and maintainer except for a few big ones.

Hmm... just getting a random file under staging/media:

./scripts/get_maintainer.pl -f drivers/staging/media/imx/imx-ic.h
Steve Longerbeam <[email protected]> (maintainer:MEDIA DRIVERS FOR FREESCALE IMX)
Philipp Zabel <[email protected]> (maintainer:MEDIA DRIVERS FOR FREESCALE IMX)
Mauro Carvalho Chehab <[email protected]> (maintainer:MEDIA INPUT INFRASTRUCTURE (V4L/DVB))
Greg Kroah-Hartman <[email protected]> (supporter:STAGING SUBSYSTEM)
[email protected] (open list:MEDIA DRIVERS FOR FREESCALE IMX)
[email protected] (open list:STAGING SUBSYSTEM)
[email protected] (open list)

It seems that the maintainers are already ordered by the tree
depth (placing the most relevant results first).

So, both driver maintainers appear first, then me and finally
Greg (as supporter).

Mailing lists are also ordered by relevance: media ML, then staging
ML and finally LKML.

Thanks,
Mauro

2018-09-12 22:50:23

by Rob Herring (Arm)

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

On Wed, Sep 12, 2018 at 4:07 PM Mauro Carvalho Chehab
<[email protected]> wrote:
>
> Em Wed, 12 Sep 2018 15:26:48 -0500
> Rob Herring <[email protected]> escreveu:
>
> > +Joe P
> >
> > On Wed, Sep 12, 2018 at 10:17 AM Mauro Carvalho Chehab
> > <[email protected]> wrote:
> > >
> > > Em Tue, 28 Aug 2018 10:44:33 -0500
> > > Rob Herring <[email protected]> escreveu:
> > >
> > > > In preparation to remove the node name pointer from struct device_node,
> > > > convert printf users to use the %pOFn format specifier.
> > > >
> > > > Cc: Steve Longerbeam <[email protected]>
> > > > Cc: Philipp Zabel <[email protected]>
> > > > Cc: Mauro Carvalho Chehab <[email protected]>
> > > > Cc: Greg Kroah-Hartman <[email protected]>
> > > > Cc: [email protected]
> > > > Cc: [email protected]
> > > > Signed-off-by: Rob Herring <[email protected]>
> > > > ---
> > > > v2:
> > > > - fix conditional use of node name vs devname for imx
> > > >
> > > > drivers/staging/media/imx/imx-media-dev.c | 15 ++++++++++-----
> > > > drivers/staging/media/imx/imx-media-of.c | 4 ++--
> > > > drivers/staging/mt7621-eth/mdio.c | 4 ++--
> > >
> > > It would be better if you had submitted the staging/media stuff
> > > on a separate patch, as they usually go via the media tree.
> >
> > Sorry, I thought Greg took all of staging.
>
> No, I usually take media patches on staging. It seems that at least
> the IIO subsystem does the same:
>
> IIO SUBSYSTEM AND DRIVERS
> M: Jonathan Cameron <[email protected]>
> R: Hartmut Knaack <[email protected]>
> R: Lars-Peter Clausen <[email protected]>
> R: Peter Meerwald-Stadler <[email protected]>
> L: [email protected]
> T: git git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
> S: Maintained
> F: Documentation/ABI/testing/configfs-iio*
> F: Documentation/ABI/testing/sysfs-bus-iio*
> F: Documentation/devicetree/bindings/iio/
> F: drivers/iio/
> F: drivers/staging/iio/
> F: include/linux/iio/
> F: tools/iio/

Yes, the information is there, but needs human processing.

> Anyway, as I said before, I don't have any issues if Greg takes
> this specific patch.

I know. I'm just thinking about how to improve things. Ideally, what
I'd like is a script that spits out a To list for who applies the
patch and a Cc list of reviewers.

> > A problem with MAINTAINERS is there is no way to tell who applies
> > patches for a given path vs. anyone else listed. This frequently
> > happens when the maintainer organization doesn't match the directory
> > org. If we distinguished this, then it would be quite easy to see when
> > you've created a patch that needs to be split to different maintainers
> > (or an explanation why it isn't). Whatever happened with splitting up
> > MAINTAINERS? If there was a file for each maintainer tree, then it
> > would be easier to extract that information.
>
> Yes, but, on the other hand, get_maintainers.pl would likely
> take more time to process, if a patch touches multiple subsystems.
>
> >
> > Or maybe we just need to be stricter with the 'M' vs. 'R' tag and 'M'
> > means that is the person who applies the patch. I don't think many
> > drivers have their own tree and maintainer except for a few big ones.
>
> Hmm... just getting a random file under staging/media:
>
> ./scripts/get_maintainer.pl -f drivers/staging/media/imx/imx-ic.h
> Steve Longerbeam <[email protected]> (maintainer:MEDIA DRIVERS FOR FREESCALE IMX)
> Philipp Zabel <[email protected]> (maintainer:MEDIA DRIVERS FOR FREESCALE IMX)
> Mauro Carvalho Chehab <[email protected]> (maintainer:MEDIA INPUT INFRASTRUCTURE (V4L/DVB))
> Greg Kroah-Hartman <[email protected]> (supporter:STAGING SUBSYSTEM)
> [email protected] (open list:MEDIA DRIVERS FOR FREESCALE IMX)
> [email protected] (open list:STAGING SUBSYSTEM)
> [email protected] (open list)
>
> It seems that the maintainers are already ordered by the tree
> depth (placing the most relevant results first).

Most relevant in the sense of who reviews and cares about the changes,
but not to answer who applies this patch. I could say I just need to
ignore supporters and look at the last maintainer, but then that
breaks for the case below. I don't think 'maintainer' vs. 'supporter'
is very well maintained either.

$ scripts/get_maintainer.pl -f drivers/staging/olpc_dcon/
Jens Frederich <[email protected]> (maintainer:STAGING - OLPC
SECONDARY DISPLAY CONTROLLER (DCON))
Daniel Drake <[email protected]> (maintainer:STAGING - OLPC SECONDARY
DISPLAY CONTROLLER (DCON))
Jon Nettleton <[email protected]> (maintainer:STAGING - OLPC
SECONDARY DISPLAY CONTROLLER (DCON))
Greg Kroah-Hartman <[email protected]> (supporter:STAGING SUBSYSTEM)
[email protected] (open list:STAGING SUBSYSTEM)
[email protected] (open list)

Maybe Jon has a tree and applies it. Who knows... You either have to
know who are "real" maintainers (the ones applying patches) or go look
at git history to see Greg is the only non-author S-o-B.

> So, both driver maintainers appear first, then me and finally
> Greg (as supporter).
>
> Mailing lists are also ordered by relevance: media ML, then staging
> ML and finally LKML.

Another clue, yes, but something you can script?

Rob

2018-09-13 20:52:09

by Joe Perches

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

On Wed, 2018-09-12 at 15:26 -0500, Rob Herring wrote:
> A problem with MAINTAINERS is there is no way to tell who applies
> patches for a given path vs. anyone else listed.

try the --scm option


2018-09-13 21:27:52

by Rob Herring (Arm)

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

On Thu, Sep 13, 2018 at 3:45 PM Joe Perches <[email protected]> wrote:
>
> On Wed, 2018-09-12 at 15:26 -0500, Rob Herring wrote:
> > A problem with MAINTAINERS is there is no way to tell who applies
> > patches for a given path vs. anyone else listed.
>
> try the --scm option

That kind of helps if the maintainer has listed a tree, but gives
wrong results if not. And you still have to figure out who owns which
tree. That's not hard, but it's not scriptable.

IMO, we should reserve 'M:' for maintainers with trees and use 'R:'
driver maintainers. That's redefining M as "maintainer" rather than
"mail patches to". You could still have both for a entry so you can
know who to go bug when your patch hasn't been applied.

Rob

2018-09-14 08:30:06

by Rafael J. Wysocki

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

On Tuesday, August 28, 2018 3:52:15 AM CEST 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: "Rafael J. Wysocki" <[email protected]>
> Cc: Viresh Kumar <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/cpufreq/s5pv210-cpufreq.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
> index 5d31c2db12a3..dbecd7667db2 100644
> --- a/drivers/cpufreq/s5pv210-cpufreq.c
> +++ b/drivers/cpufreq/s5pv210-cpufreq.c
> @@ -611,8 +611,8 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
> for_each_compatible_node(np, NULL, "samsung,s5pv210-dmc") {
> id = of_alias_get_id(np, "dmc");
> if (id < 0 || id >= ARRAY_SIZE(dmc_base)) {
> - pr_err("%s: failed to get alias of dmc node '%s'\n",
> - __func__, np->name);
> + pr_err("%s: failed to get alias of dmc node '%pOFn'\n",
> + __func__, np);
> of_node_put(np);
> return id;
> }
>

Applied, thanks!



2018-09-14 11:43:52

by Joe Perches

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

On Thu, 2018-09-13 at 16:26 -0500, Rob Herring wrote:
> On Thu, Sep 13, 2018 at 3:45 PM Joe Perches <[email protected]> wrote:
> >
> > On Wed, 2018-09-12 at 15:26 -0500, Rob Herring wrote:
> > > A problem with MAINTAINERS is there is no way to tell who applies
> > > patches for a given path vs. anyone else listed.
> >
> > try the --scm option
>
> That kind of helps if the maintainer has listed a tree, but gives
> wrong results if not.

If there isn't a tree listed, it's not really maintained.

> And you still have to figure out who owns which
> tree. That's not hard, but it's not scriptable.

a get_maintainer scripted loop using
--maxdepth=<incrementing_from_1> --scm --m --nor --nol
until a result could work.

> IMO, we should reserve 'M:' for maintainers with trees and use 'R:'
> driver maintainers. That's redefining M as "maintainer" rather than
> "mail patches to". You could still have both for a entry so you can
> know who to go bug when your patch hasn't been applied.

IMO, most M: entries in MAINTAINERS are either reviewers or
used-once when created and longer active or just vanity.

2018-09-28 21:19:41

by Rob Herring (Arm)

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

On Tue, Aug 28, 2018 at 12:02 PM Will Deacon <[email protected]> wrote:
>
> On Mon, Aug 27, 2018 at 08:52:39PM -0500, 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: Will Deacon <[email protected]>
> > Cc: Mark Rutland <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Rob Herring <[email protected]>
> > ---
> > drivers/perf/arm_pmu_platform.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
>
> Cheers, I can queue this up for 4.20. Let me know if you'd rather take it
> along with the name pointer removal instead.

I assumed you were going to take this since I didn't say otherwise,
but looks like it is not in linux-next. Please take thru your tree.

Rob

2018-09-28 21:48:16

by Rob Herring (Arm)

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

On Mon, Aug 27, 2018 at 8:53 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.
>
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/firmware/scpi_pm_domain.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Sudeep, looks like I missed Cc'ing you (or anyone) on this. Can you
please ack or apply this.

>
> diff --git a/drivers/firmware/scpi_pm_domain.c b/drivers/firmware/scpi_pm_domain.c
> index f395dec27113..390aa13391e4 100644
> --- a/drivers/firmware/scpi_pm_domain.c
> +++ b/drivers/firmware/scpi_pm_domain.c
> @@ -121,7 +121,7 @@ static int scpi_pm_domain_probe(struct platform_device *pdev)
>
> scpi_pd->domain = i;
> scpi_pd->ops = scpi_ops;
> - sprintf(scpi_pd->name, "%s.%d", np->name, i);
> + sprintf(scpi_pd->name, "%pOFn.%d", np, i);
> scpi_pd->genpd.name = scpi_pd->name;
> scpi_pd->genpd.power_off = scpi_pd_power_off;
> scpi_pd->genpd.power_on = scpi_pd_power_on;
> --
> 2.17.1
>

2018-09-28 21:54:45

by Rob Herring (Arm)

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

On Mon, Aug 27, 2018 at 8:54 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: Jassi Brar <[email protected]>
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/mailbox/ti-msgmgr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Ping.

>
> diff --git a/drivers/mailbox/ti-msgmgr.c b/drivers/mailbox/ti-msgmgr.c
> index 5bceafbf6699..713d701b6568 100644
> --- a/drivers/mailbox/ti-msgmgr.c
> +++ b/drivers/mailbox/ti-msgmgr.c
> @@ -560,8 +560,8 @@ static struct mbox_chan *ti_msgmgr_of_xlate(struct mbox_controller *mbox,
> }
>
> err:
> - dev_err(inst->dev, "Queue ID %d, Proxy ID %d is wrong on %s\n",
> - req_qid, req_pid, p->np->name);
> + dev_err(inst->dev, "Queue ID %d, Proxy ID %d is wrong on %pOFn\n",
> + req_qid, req_pid, p->np);
> return ERR_PTR(-ENOENT);
> }
>
> --
> 2.17.1
>

2018-09-28 21:56:07

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH] input: sun4i-lradc: Convert to using %pOFn instead of device_node.name

On Mon, Aug 27, 2018 at 8:54 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: Hans de Goede <[email protected]>
> Cc: Dmitry Torokhov <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/input/keyboard/sun4i-lradc-keys.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)

Ping.

>
> diff --git a/drivers/input/keyboard/sun4i-lradc-keys.c b/drivers/input/keyboard/sun4i-lradc-keys.c
> index a37c172452e6..57272df34cd5 100644
> --- a/drivers/input/keyboard/sun4i-lradc-keys.c
> +++ b/drivers/input/keyboard/sun4i-lradc-keys.c
> @@ -185,19 +185,19 @@ static int sun4i_lradc_load_dt_keymap(struct device *dev,
>
> error = of_property_read_u32(pp, "channel", &channel);
> if (error || channel != 0) {
> - dev_err(dev, "%s: Inval channel prop\n", pp->name);
> + dev_err(dev, "%pOFn: Inval channel prop\n", pp);
> return -EINVAL;
> }
>
> error = of_property_read_u32(pp, "voltage", &map->voltage);
> if (error) {
> - dev_err(dev, "%s: Inval voltage prop\n", pp->name);
> + dev_err(dev, "%pOFn: Inval voltage prop\n", pp);
> return -EINVAL;
> }
>
> error = of_property_read_u32(pp, "linux,code", &map->keycode);
> if (error) {
> - dev_err(dev, "%s: Inval linux,code prop\n", pp->name);
> + dev_err(dev, "%pOFn: Inval linux,code prop\n", pp);
> return -EINVAL;
> }
>
> --
> 2.17.1
>

2018-09-28 22:06:53

by Rob Herring (Arm)

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

On Mon, Aug 27, 2018 at 8:55 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: Srinivas Kandagatla <[email protected]>
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/nvmem/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

Ping. This has no dependencies, so please apply.

Rob

>
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index aa1657831b70..6988ee9f11ba 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -304,6 +304,7 @@ static void nvmem_cell_drop(struct nvmem_cell *cell)
> mutex_lock(&nvmem_cells_mutex);
> list_del(&cell->node);
> mutex_unlock(&nvmem_cells_mutex);
> + kfree(cell->name);
> kfree(cell);
> }
>
> @@ -879,7 +880,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
> cell->nvmem = nvmem;
> cell->offset = be32_to_cpup(addr++);
> cell->bytes = be32_to_cpup(addr);
> - cell->name = cell_np->name;
> + cell->name = kasprintf(GFP_KERNEL, "%pOFn", cell_np);
>
> addr = of_get_property(cell_np, "bits", &len);
> if (addr && len == (2 * sizeof(u32))) {
> @@ -904,6 +905,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
> return cell;
>
> err_sanity:
> + kfree(cell->name);
> kfree(cell);
>
> err_mem:
> --
> 2.17.1
>

2018-09-28 22:09:37

by Rob Herring (Arm)

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

On Mon, Aug 27, 2018 at 8:55 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: Greg Kroah-Hartman <[email protected]>
> Cc: Jiri Slaby <[email protected]>
> Cc: Benjamin Herrenschmidt <[email protected]>
> Cc: Paul Mackerras <[email protected]>
> Cc: Michael Ellerman <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/tty/ehv_bytechan.c | 12 ++++++------
> drivers/tty/serial/cpm_uart/cpm_uart_core.c | 8 ++++----
> drivers/tty/serial/pmac_zilog.c | 4 ++--
> 3 files changed, 12 insertions(+), 12 deletions(-)

Hey Greg, Is this still in your queue? Maybe you've just been extra
busy lately. ;)

Rob
>
> diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c
> index eea4049b5dcc..769e0a5d1dfc 100644
> --- a/drivers/tty/ehv_bytechan.c
> +++ b/drivers/tty/ehv_bytechan.c
> @@ -128,8 +128,8 @@ static int find_console_handle(void)
> */
> iprop = of_get_property(np, "hv-handle", NULL);
> if (!iprop) {
> - pr_err("ehv-bc: no 'hv-handle' property in %s node\n",
> - np->name);
> + pr_err("ehv-bc: no 'hv-handle' property in %pOFn node\n",
> + np);
> return 0;
> }
> stdout_bc = be32_to_cpu(*iprop);
> @@ -661,8 +661,8 @@ static int ehv_bc_tty_probe(struct platform_device *pdev)
>
> iprop = of_get_property(np, "hv-handle", NULL);
> if (!iprop) {
> - dev_err(&pdev->dev, "no 'hv-handle' property in %s node\n",
> - np->name);
> + dev_err(&pdev->dev, "no 'hv-handle' property in %pOFn node\n",
> + np);
> return -ENODEV;
> }
>
> @@ -682,8 +682,8 @@ static int ehv_bc_tty_probe(struct platform_device *pdev)
> bc->rx_irq = irq_of_parse_and_map(np, 0);
> bc->tx_irq = irq_of_parse_and_map(np, 1);
> if ((bc->rx_irq == NO_IRQ) || (bc->tx_irq == NO_IRQ)) {
> - dev_err(&pdev->dev, "no 'interrupts' property in %s node\n",
> - np->name);
> + dev_err(&pdev->dev, "no 'interrupts' property in %pOFn node\n",
> + np);
> ret = -ENODEV;
> goto error;
> }
> diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
> index 24a5f05e769b..ea7204d75022 100644
> --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
> +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
> @@ -1151,8 +1151,8 @@ static int cpm_uart_init_port(struct device_node *np,
> if (!pinfo->clk) {
> data = of_get_property(np, "fsl,cpm-brg", &len);
> if (!data || len != 4) {
> - printk(KERN_ERR "CPM UART %s has no/invalid "
> - "fsl,cpm-brg property.\n", np->name);
> + printk(KERN_ERR "CPM UART %pOFn has no/invalid "
> + "fsl,cpm-brg property.\n", np);
> return -EINVAL;
> }
> pinfo->brg = *data;
> @@ -1160,8 +1160,8 @@ static int cpm_uart_init_port(struct device_node *np,
>
> data = of_get_property(np, "fsl,cpm-command", &len);
> if (!data || len != 4) {
> - printk(KERN_ERR "CPM UART %s has no/invalid "
> - "fsl,cpm-command property.\n", np->name);
> + printk(KERN_ERR "CPM UART %pOFn has no/invalid "
> + "fsl,cpm-command property.\n", np);
> return -EINVAL;
> }
> pinfo->command = *data;
> diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
> index 3d21790d961e..a4ec22d1f214 100644
> --- a/drivers/tty/serial/pmac_zilog.c
> +++ b/drivers/tty/serial/pmac_zilog.c
> @@ -1566,9 +1566,9 @@ static int pmz_attach(struct macio_dev *mdev, const struct of_device_id *match)
> * to work around bugs in ancient Apple device-trees
> */
> if (macio_request_resources(uap->dev, "pmac_zilog"))
> - printk(KERN_WARNING "%s: Failed to request resource"
> + printk(KERN_WARNING "%pOFn: Failed to request resource"
> ", port still active\n",
> - uap->node->name);
> + uap->node);
> else
> uap->flags |= PMACZILOG_FLAG_RSRC_REQUESTED;
>
> --
> 2.17.1
>

2018-09-28 22:12:26

by Rob Herring (Arm)

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

On Mon, Aug 27, 2018 at 8:55 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: Bartlomiej Zolnierkiewicz <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> drivers/video/fbdev/cg14.c | 4 +---
> drivers/video/fbdev/cg3.c | 2 +-
> drivers/video/fbdev/core/fbmon.c | 4 ++--
> drivers/video/fbdev/imsttfb.c | 2 +-
> drivers/video/fbdev/leo.c | 2 +-
> drivers/video/fbdev/offb.c | 12 ++++++++----
> drivers/video/fbdev/p9100.c | 2 +-
> drivers/video/of_display_timing.c | 2 +-
> 8 files changed, 16 insertions(+), 14 deletions(-)

Ping!

>
> diff --git a/drivers/video/fbdev/cg14.c b/drivers/video/fbdev/cg14.c
> index 8de88b129b62..9af54c2368fd 100644
> --- a/drivers/video/fbdev/cg14.c
> +++ b/drivers/video/fbdev/cg14.c
> @@ -355,9 +355,7 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
> static void cg14_init_fix(struct fb_info *info, int linebytes,
> struct device_node *dp)
> {
> - const char *name = dp->name;
> -
> - strlcpy(info->fix.id, name, sizeof(info->fix.id));
> + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
>
> info->fix.type = FB_TYPE_PACKED_PIXELS;
> info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
> diff --git a/drivers/video/fbdev/cg3.c b/drivers/video/fbdev/cg3.c
> index 6c334260cf53..1bd95b02f3aa 100644
> --- a/drivers/video/fbdev/cg3.c
> +++ b/drivers/video/fbdev/cg3.c
> @@ -246,7 +246,7 @@ static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
> static void cg3_init_fix(struct fb_info *info, int linebytes,
> struct device_node *dp)
> {
> - strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
> + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
>
> info->fix.type = FB_TYPE_PACKED_PIXELS;
> info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
> diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
> index 852d86c1c527..dd3128990776 100644
> --- a/drivers/video/fbdev/core/fbmon.c
> +++ b/drivers/video/fbdev/core/fbmon.c
> @@ -1480,8 +1480,8 @@ int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb,
> if (ret)
> return ret;
>
> - pr_debug("%pOF: got %dx%d display mode from %s\n",
> - np, vm.hactive, vm.vactive, np->name);
> + pr_debug("%pOF: got %dx%d display mode\n",
> + np, vm.hactive, vm.vactive);
> dump_fb_videomode(fb);
>
> return 0;
> diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c
> index ecdcf358ad5e..901ca4ed10e9 100644
> --- a/drivers/video/fbdev/imsttfb.c
> +++ b/drivers/video/fbdev/imsttfb.c
> @@ -1473,7 +1473,7 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>
> dp = pci_device_to_OF_node(pdev);
> if(dp)
> - printk(KERN_INFO "%s: OF name %s\n",__func__, dp->name);
> + printk(KERN_INFO "%s: OF name %pOFn\n",__func__, dp);
> else if (IS_ENABLED(CONFIG_OF))
> printk(KERN_ERR "imsttfb: no OF node for pci device\n");
>
> diff --git a/drivers/video/fbdev/leo.c b/drivers/video/fbdev/leo.c
> index 71862188f528..446ac3364bad 100644
> --- a/drivers/video/fbdev/leo.c
> +++ b/drivers/video/fbdev/leo.c
> @@ -434,7 +434,7 @@ static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
> static void
> leo_init_fix(struct fb_info *info, struct device_node *dp)
> {
> - strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
> + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
>
> info->fix.type = FB_TYPE_PACKED_PIXELS;
> info->fix.visual = FB_VISUAL_TRUECOLOR;
> diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
> index 77c0a2f45b3b..31f769d67195 100644
> --- a/drivers/video/fbdev/offb.c
> +++ b/drivers/video/fbdev/offb.c
> @@ -419,9 +419,13 @@ static void __init offb_init_fb(const char *name,
> var = &info->var;
> info->par = par;
>
> - strcpy(fix->id, "OFfb ");
> - strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb "));
> - fix->id[sizeof(fix->id) - 1] = '\0';
> + if (name) {
> + strcpy(fix->id, "OFfb ");
> + strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb "));
> + fix->id[sizeof(fix->id) - 1] = '\0';
> + } else
> + snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp);
> +
>
> var->xres = var->xres_virtual = width;
> var->yres = var->yres_virtual = height;
> @@ -644,7 +648,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
> /* kludge for valkyrie */
> if (strcmp(dp->name, "valkyrie") == 0)
> address += 0x1000;
> - offb_init_fb(no_real_node ? "bootx" : dp->name,
> + offb_init_fb(no_real_node ? "bootx" : NULL,
> width, height, depth, pitch, address,
> foreign_endian, no_real_node ? NULL : dp);
> }
> diff --git a/drivers/video/fbdev/p9100.c b/drivers/video/fbdev/p9100.c
> index 64de5cda541d..c4283e9e95af 100644
> --- a/drivers/video/fbdev/p9100.c
> +++ b/drivers/video/fbdev/p9100.c
> @@ -239,7 +239,7 @@ static int p9100_ioctl(struct fb_info *info, unsigned int cmd,
>
> static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_node *dp)
> {
> - strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
> + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
>
> info->fix.type = FB_TYPE_PACKED_PIXELS;
> info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
> diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
> index 5244e93ceafc..c2e7aa103fa5 100644
> --- a/drivers/video/of_display_timing.c
> +++ b/drivers/video/of_display_timing.c
> @@ -170,7 +170,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
> goto entryfail;
> }
>
> - pr_debug("%pOF: using %s as default timing\n", np, entry->name);
> + pr_debug("%pOF: using %pOFn as default timing\n", np, entry);
>
> native_mode = entry;
>
> --
> 2.17.1
>

2018-09-28 22:34:39

by Rob Herring (Arm)

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

On Fri, Sep 28, 2018 at 5:09 PM Rob Herring <[email protected]> wrote:
>
> On Mon, Aug 27, 2018 at 8:55 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: Greg Kroah-Hartman <[email protected]>
> > Cc: Jiri Slaby <[email protected]>
> > Cc: Benjamin Herrenschmidt <[email protected]>
> > Cc: Paul Mackerras <[email protected]>
> > Cc: Michael Ellerman <[email protected]>
> > Cc: [email protected]
> > Cc: [email protected]
> > Signed-off-by: Rob Herring <[email protected]>
> > ---
> > drivers/tty/ehv_bytechan.c | 12 ++++++------
> > drivers/tty/serial/cpm_uart/cpm_uart_core.c | 8 ++++----
> > drivers/tty/serial/pmac_zilog.c | 4 ++--
> > 3 files changed, 12 insertions(+), 12 deletions(-)
>
> Hey Greg, Is this still in your queue? Maybe you've just been extra
> busy lately. ;)

NM. I see it's applied now. Sorry for the noise.

Rob

2018-09-29 00:00:07

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] input: sun4i-lradc: Convert to using %pOFn instead of device_node.name

On Mon, Aug 27, 2018 at 08:52:24PM -0500, 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: Hans de Goede <[email protected]>
> Cc: Dmitry Torokhov <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Applied, thank you.

> ---
> drivers/input/keyboard/sun4i-lradc-keys.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/keyboard/sun4i-lradc-keys.c b/drivers/input/keyboard/sun4i-lradc-keys.c
> index a37c172452e6..57272df34cd5 100644
> --- a/drivers/input/keyboard/sun4i-lradc-keys.c
> +++ b/drivers/input/keyboard/sun4i-lradc-keys.c
> @@ -185,19 +185,19 @@ static int sun4i_lradc_load_dt_keymap(struct device *dev,
>
> error = of_property_read_u32(pp, "channel", &channel);
> if (error || channel != 0) {
> - dev_err(dev, "%s: Inval channel prop\n", pp->name);
> + dev_err(dev, "%pOFn: Inval channel prop\n", pp);
> return -EINVAL;
> }
>
> error = of_property_read_u32(pp, "voltage", &map->voltage);
> if (error) {
> - dev_err(dev, "%s: Inval voltage prop\n", pp->name);
> + dev_err(dev, "%pOFn: Inval voltage prop\n", pp);
> return -EINVAL;
> }
>
> error = of_property_read_u32(pp, "linux,code", &map->keycode);
> if (error) {
> - dev_err(dev, "%s: Inval linux,code prop\n", pp->name);
> + dev_err(dev, "%pOFn: Inval linux,code prop\n", pp);
> return -EINVAL;
> }
>
> --
> 2.17.1
>

--
Dmitry

2018-09-30 17:09:15

by Andy Gross

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

On Mon, Aug 27, 2018 at 08:52:44PM -0500, 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: Qiang Zhao <[email protected]>
> Cc: Li Yang <[email protected]>
> Cc: Andy Gross <[email protected]>
> Cc: David Brown <[email protected]>
> Cc: Heiko Stuebner <[email protected]>
> Cc: Thierry Reding <[email protected]>
> Cc: Jonathan Hunter <[email protected]>
> Cc: Santosh Shilimkar <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---

Acked-by: Andy Gross <[email protected]>

2018-10-01 09:05:44

by Srinivas Kandagatla

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



On 28/09/18 23:06, Rob Herring wrote:
> On Mon, Aug 27, 2018 at 8:55 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: Srinivas Kandagatla <[email protected]>
>> Signed-off-by: Rob Herring <[email protected]>
>> ---
>> drivers/nvmem/core.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> Ping. This has no dependencies, so please apply.

Sorry, Looks like I missed this one!
I already re-based it. I will send it with other fixes to Greg KH soon!

thanks,
--srini
>
> Rob
>
>>
>> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
>> index aa1657831b70..6988ee9f11ba 100644
>> --- a/drivers/nvmem/core.c
>> +++ b/drivers/nvmem/core.c
>> @@ -304,6 +304,7 @@ static void nvmem_cell_drop(struct nvmem_cell *cell)
>> mutex_lock(&nvmem_cells_mutex);
>> list_del(&cell->node);
>> mutex_unlock(&nvmem_cells_mutex);
>> + kfree(cell->name);
>> kfree(cell);
>> }
>>
>> @@ -879,7 +880,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
>> cell->nvmem = nvmem;
>> cell->offset = be32_to_cpup(addr++);
>> cell->bytes = be32_to_cpup(addr);
>> - cell->name = cell_np->name;
>> + cell->name = kasprintf(GFP_KERNEL, "%pOFn", cell_np);
>>
>> addr = of_get_property(cell_np, "bits", &len);
>> if (addr && len == (2 * sizeof(u32))) {
>> @@ -904,6 +905,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
>> return cell;
>>
>> err_sanity:
>> + kfree(cell->name);
>> kfree(cell);
>>
>> err_mem:
>> --
>> 2.17.1
>>

2018-10-01 09:10:42

by Sudeep Holla

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

On Fri, Sep 28, 2018 at 04:47:41PM -0500, Rob Herring wrote:
> On Mon, Aug 27, 2018 at 8:53 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.
> >
> > Signed-off-by: Rob Herring <[email protected]>
> > ---
> > drivers/firmware/scpi_pm_domain.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Sudeep, looks like I missed Cc'ing you (or anyone) on this. Can you
> please ack or apply this.
>
I prefer you to take it via your tree as that may be easier.

Acked-by: Sudeep Holla <[email protected]>

--
Regards,
Sudeep


2018-10-01 09:18:51

by Will Deacon

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

On Fri, Sep 28, 2018 at 04:19:07PM -0500, Rob Herring wrote:
> On Tue, Aug 28, 2018 at 12:02 PM Will Deacon <[email protected]> wrote:
> >
> > On Mon, Aug 27, 2018 at 08:52:39PM -0500, 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: Will Deacon <[email protected]>
> > > Cc: Mark Rutland <[email protected]>
> > > Cc: [email protected]
> > > Signed-off-by: Rob Herring <[email protected]>
> > > ---
> > > drivers/perf/arm_pmu_platform.c | 6 +++---
> > > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > Cheers, I can queue this up for 4.20. Let me know if you'd rather take it
> > along with the name pointer removal instead.
>
> I assumed you were going to take this since I didn't say otherwise,
> but looks like it is not in linux-next. Please take thru your tree.

Sorry, slipped through the cracks. I'll get it queued asap for the merge
window.

Will

2018-10-04 06:15:10

by Michael Ellerman

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

On Tue, 2018-08-28 at 01:52:07 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.
>
> Cc: Benjamin Herrenschmidt <[email protected]>
> Cc: Paul Mackerras <[email protected]>
> Cc: Michael Ellerman <[email protected]>
> Cc: Arnd Bergmann <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/b9ef7b4b867f56114bedbe6bf104cf

cheers

2018-10-08 05:58:36

by David Miller

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

From: Rob Herring <[email protected]>
Date: Tue, 28 Aug 2018 10:44:32 -0500

> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
>
> Cc: "David S. Miller" <[email protected]>
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>
> ---
> v2:
> - snprint -> snprintf typo fix

Applied.

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


On 08/28/2018 03:52 AM, 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: Bartlomiej Zolnierkiewicz <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Rob Herring <[email protected]>

Patch queued for 4.20, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics