Skip to contentSkip to conversation

soc: Convert to using %pOF instead of full_name

PATCH Applied Rob Herring 6 participants 7 messages Jul 18, 2017 – Aug 16, 2017

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

PATCH 1/1 soc: Convert to using %pOF instead of full_name

Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node.

Cc Scott Wood <[email protected]>
Cc Qiang Zhao <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc Simon Horman <[email protected]>
Cc Magnus Damm <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Cc linuxppc-dev at lists.ozlabs.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-mediatek at lists.infradead.org
Cc linux-renesas-soc at vger.kernel.org
Cc linux-samsung-soc at vger.kernel.org
---
 drivers/soc/fsl/qbman/bman_ccsr.c    | 10 +++++-----
 drivers/soc/fsl/qbman/bman_portal.c  |  8 +++-----
 drivers/soc/fsl/qbman/qman_ccsr.c    | 12 ++++++------
 drivers/soc/fsl/qbman/qman_portal.c  | 11 ++++-------
 drivers/soc/fsl/qe/gpio.c            |  4 ++--
 drivers/soc/mediatek/mtk-pmic-wrap.c |  4 ++--
 drivers/soc/renesas/rcar-rst.c       |  4 ++--
 drivers/soc/renesas/rcar-sysc.c      |  6 +++---
 drivers/soc/samsung/pm_domains.c     |  8 ++++----
 9 files changed, 31 insertions(+), 36 deletions(-)
drivers/soc/fsl/qbman/bman_ccsr.c +5 -5
index a8e8389a6894..eaa9585c7347 100644
@@ -177,8 +177,8 @@ static int fsl_bman_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
-		dev_err(dev, "Can't get %s property 'IORESOURCE_MEM'\n",
-			node->full_name);
+		dev_err(dev, "Can't get %pOF property 'IORESOURCE_MEM'\n",
+			node);
 		return -ENXIO;
 	}
 	bm_ccsr_start = devm_ioremap(dev, res->start, resource_size(res));
@@ -205,14 +205,14 @@ static int fsl_bman_probe(struct platform_device *pdev)
 
 	err_irq = platform_get_irq(pdev, 0);
 	if (err_irq <= 0) {
-		dev_info(dev, "Can't get %s IRQ\n", node->full_name);
+		dev_info(dev, "Can't get %pOF IRQ\n", node);
 		return -ENODEV;
 	}
 	ret = devm_request_irq(dev, err_irq, bman_isr, IRQF_SHARED, "bman-err",
 			       dev);
 	if (ret)  {
-		dev_err(dev, "devm_request_irq() failed %d for '%s'\n",
-			ret, node->full_name);
+		dev_err(dev, "devm_request_irq() failed %d for '%pOF'\n",
+			ret, node);
 		return ret;
 	}
 	/* Disable Buffer Pool State Change */
drivers/soc/fsl/qbman/bman_portal.c +3 -5
index 8354d4dabdad..39b39c8f1399 100644
@@ -103,16 +103,14 @@ static int bman_portal_probe(struct platform_device *pdev)
 	addr_phys[0] = platform_get_resource(pdev, IORESOURCE_MEM,
 					     DPAA_PORTAL_CE);
 	if (!addr_phys[0]) {
-		dev_err(dev, "Can't get %s property 'reg::CE'\n",
-			node->full_name);
+		dev_err(dev, "Can't get %pOF property 'reg::CE'\n", node);
 		return -ENXIO;
 	}
 
 	addr_phys[1] = platform_get_resource(pdev, IORESOURCE_MEM,
 					     DPAA_PORTAL_CI);
 	if (!addr_phys[1]) {
-		dev_err(dev, "Can't get %s property 'reg::CI'\n",
-			node->full_name);
+		dev_err(dev, "Can't get %pOF property 'reg::CI'\n", node);
 		return -ENXIO;
 	}
 
@@ -120,7 +118,7 @@ static int bman_portal_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq <= 0) {
-		dev_err(dev, "Can't get %s IRQ'\n", node->full_name);
+		dev_err(dev, "Can't get %pOF IRQ'\n", node);
 		return -ENXIO;
 	}
 	pcfg->irq = irq;
drivers/soc/fsl/qbman/qman_ccsr.c +6 -6
index 90bc40c48675..835ce947ffca 100644
@@ -695,8 +695,8 @@ static int fsl_qman_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
-		dev_err(dev, "Can't get %s property 'IORESOURCE_MEM'\n",
-			node->full_name);
+		dev_err(dev, "Can't get %pOF property 'IORESOURCE_MEM'\n",
+			node);
 		return -ENXIO;
 	}
 	qm_ccsr_start = devm_ioremap(dev, res->start, resource_size(res));
@@ -740,15 +740,15 @@ static int fsl_qman_probe(struct platform_device *pdev)
 
 	err_irq = platform_get_irq(pdev, 0);
 	if (err_irq <= 0) {
-		dev_info(dev, "Can't get %s property 'interrupts'\n",
-			 node->full_name);
+		dev_info(dev, "Can't get %pOF property 'interrupts'\n",
+			 node);
 		return -ENODEV;
 	}
 	ret = devm_request_irq(dev, err_irq, qman_isr, IRQF_SHARED, "qman-err",
 			       dev);
 	if (ret)  {
-		dev_err(dev, "devm_request_irq() failed %d for '%s'\n",
-			ret, node->full_name);
+		dev_err(dev, "devm_request_irq() failed %d for '%pOF'\n",
+			ret, node);
 		return ret;
 	}
 
drivers/soc/fsl/qbman/qman_portal.c +4 -7
index adbaa30d3c5a..cbacdf4f98ed 100644
@@ -237,30 +237,27 @@ static int qman_portal_probe(struct platform_device *pdev)
 	addr_phys[0] = platform_get_resource(pdev, IORESOURCE_MEM,
 					     DPAA_PORTAL_CE);
 	if (!addr_phys[0]) {
-		dev_err(dev, "Can't get %s property 'reg::CE'\n",
-			node->full_name);
+		dev_err(dev, "Can't get %pOF property 'reg::CE'\n", node);
 		return -ENXIO;
 	}
 
 	addr_phys[1] = platform_get_resource(pdev, IORESOURCE_MEM,
 					     DPAA_PORTAL_CI);
 	if (!addr_phys[1]) {
-		dev_err(dev, "Can't get %s property 'reg::CI'\n",
-			node->full_name);
+		dev_err(dev, "Can't get %pOF property 'reg::CI'\n", node);
 		return -ENXIO;
 	}
 
 	err = of_property_read_u32(node, "cell-index", &val);
 	if (err) {
-		dev_err(dev, "Can't get %s property 'cell-index'\n",
-			node->full_name);
+		dev_err(dev, "Can't get %pOF property 'cell-index'\n", node);
 		return err;
 	}
 	pcfg->channel = val;
 	pcfg->cpu = -1;
 	irq = platform_get_irq(pdev, 0);
 	if (irq <= 0) {
-		dev_err(dev, "Can't get %s IRQ\n", node->full_name);
+		dev_err(dev, "Can't get %pOF IRQ\n", node);
 		return -ENXIO;
 	}
 	pcfg->irq = irq;
drivers/soc/fsl/qe/gpio.c +2 -2
index 0aaf429f31d5..3b27075c21a7 100644
@@ -304,8 +304,8 @@ static int __init qe_add_gpiochips(void)
 			goto err;
 		continue;
 err:
-		pr_err("%s: registration failed with status %d\n",
-		       np->full_name, ret);
+		pr_err("%pOF: registration failed with status %d\n",
+		       np, ret);
 		kfree(qe_gc);
 		/* try others anyway */
 	}
drivers/soc/mediatek/mtk-pmic-wrap.c +2 -2
index c80a04e1b2b1..af9768db42b4 100644
@@ -1233,8 +1233,8 @@ static int pwrap_probe(struct platform_device *pdev)
 
 	ret = of_platform_populate(np, NULL, NULL, wrp->dev);
 	if (ret) {
-		dev_dbg(wrp->dev, "failed to create child devices at %s\n",
-				np->full_name);
+		dev_dbg(wrp->dev, "failed to create child devices at %pOF\n",
+				np);
 		goto err_out2;
 	}
 
drivers/soc/renesas/rcar-rst.c +2 -2
index a6d1c26d3167..78c40d5dd62b 100644
@@ -61,7 +61,7 @@ static int __init rcar_rst_init(void)
 
 	base = of_iomap(np, 0);
 	if (!base) {
-		pr_warn("%s: Cannot map regs\n", np->full_name);
+		pr_warn("%pOF: Cannot map regs\n", np);
 		error = -ENOMEM;
 		goto out_put;
 	}
@@ -70,7 +70,7 @@ static int __init rcar_rst_init(void)
 	cfg = match->data;
 	saved_mode = ioread32(base + cfg->modemr);
 
-	pr_debug("%s: MODE = 0x%08x\n", np->full_name, saved_mode);
+	pr_debug("%pOF: MODE = 0x%08x\n", np, saved_mode);
 
 out_put:
 	of_node_put(np);
drivers/soc/renesas/rcar-sysc.c +3 -3
index 7c8da3c90011..cd387347fa94 100644
@@ -323,7 +323,7 @@ static int __init rcar_sysc_pd_init(void)
 
 	base = of_iomap(np, 0);
 	if (!base) {
-		pr_warn("%s: Cannot map regs\n", np->full_name);
+		pr_warn("%pOF: Cannot map regs\n", np);
 		error = -ENOMEM;
 		goto out_put;
 	}
@@ -348,13 +348,13 @@ static int __init rcar_sysc_pd_init(void)
 	 */
 	syscimr = ioread32(base + SYSCIMR);
 	syscimr |= syscier;
-	pr_debug("%s: syscimr = 0x%08x\n", np->full_name, syscimr);
+	pr_debug("%pOF: syscimr = 0x%08x\n", np, syscimr);
 	iowrite32(syscimr, base + SYSCIMR);
 
 	/*
 	 * SYSC needs all interrupt sources enabled to control power.
 	 */
-	pr_debug("%s: syscier = 0x%08x\n", np->full_name, syscier);
+	pr_debug("%pOF: syscier = 0x%08x\n", np, syscier);
 	iowrite32(syscier, base + SYSCIER);
 
 	for (i = 0; i < info->num_areas; i++) {
drivers/soc/samsung/pm_domains.c +4 -4
index a6a5d807cc2b..c630eba32066 100644
@@ -237,11 +237,11 @@ static __init int exynos4_pm_init_power_domain(void)
 			continue;
 
 		if (of_genpd_add_subdomain(&parent, &child))
-			pr_warn("%s failed to add subdomain: %s\n",
-				parent.np->full_name, child.np->full_name);
+			pr_warn("%pOF failed to add subdomain: %pOF\n",
+				parent.np, child.np);
 		else
-			pr_info("%s has as child subdomain: %s.\n",
-				parent.np->full_name, child.np->full_name);
+			pr_info("%pOF has as child subdomain: %pOF.\n",
+				parent.np, child.np);
 	}
 
 	return 0;

--
2.11.0

maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 30 lines · Rob Herring

Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node.

Cc Scott Wood <[email protected]>
Cc Qiang Zhao <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc Simon Horman <[email protected]>
Cc Magnus Damm <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Cc linuxppc-dev at lists.ozlabs.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-mediatek at lists.infradead.org
Cc linux-renesas-soc at vger.kernel.org
Cc linux-samsung-soc at vger.kernel.org
---
 drivers/soc/fsl/qbman/bman_ccsr.c    | 10 +++++-----
 drivers/soc/fsl/qbman/bman_portal.c  |  8 +++-----
 drivers/soc/fsl/qbman/qman_ccsr.c    | 12 ++++++------
 drivers/soc/fsl/qbman/qman_portal.c  | 11 ++++-------
 drivers/soc/fsl/qe/gpio.c            |  4 ++--
 drivers/soc/mediatek/mtk-pmic-wrap.c |  4 ++--
 drivers/soc/renesas/rcar-rst.c       |  4 ++--
 drivers/soc/renesas/rcar-sysc.c      |  6 +++---
 drivers/soc/samsung/pm_domains.c     |  8 ++++----
 9 files changed, 31 insertions(+), 36 deletions(-)

(...)

Quoted 10 lines
drivers/soc/samsung/pm_domains.c +0 -2
index a6a5d807cc2b..c630eba32066 100644
@@ -237,11 +237,11 @@ static __init int exynos4_pm_init_power_domain(void)
 			continue;
 
 		if (of_genpd_add_subdomain(&parent, &child))
-			pr_warn("%s failed to add subdomain: %s\n",
-				parent.np->full_name, child.np->full_name);

drivers/soc/samsung/pm_domains.c static __init int exynos4_pm_init_power_domain(void) · line 247

Quoted 10 lines
drivers/soc/samsung/pm_domains.c +4 -2
+			pr_warn("%pOF failed to add subdomain: %pOF\n",
+				parent.np, child.np);
 		else
-			pr_info("%s has as child subdomain: %s.\n",
-				parent.np->full_name, child.np->full_name);
+			pr_info("%pOF has as child subdomain: %pOF.\n",
+				parent.np, child.np);
 	}
 
 	return 0;

I guess this will go through arm-soc?

For Samsung, looks good:

Best regards,
Krzysztof

Reviewed-by on v1 1/1
#2 lore raw
In reply to Rob Herring
Quoted 5 lines · Rob Herring

Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

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

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Rob Herring
Quoted 18 lines · Rob Herring

Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node.

Cc Scott Wood <[email protected]>
Cc Qiang Zhao <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc Simon Horman <[email protected]>
Cc Magnus Damm <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Cc linuxppc-dev at lists.ozlabs.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-mediatek at lists.infradead.org
Cc linux-renesas-soc at vger.kernel.org
Cc linux-samsung-soc at vger.kernel.org
Quoted 7 lines
---
  drivers/soc/fsl/qbman/bman_ccsr.c    | 10 +++++-----
  drivers/soc/fsl/qbman/bman_portal.c  |  8 +++-----
  drivers/soc/fsl/qbman/qman_ccsr.c    | 12 ++++++------
  drivers/soc/fsl/qbman/qman_portal.c  | 11 ++++-------
  drivers/soc/fsl/qe/gpio.c            |  4 ++--
  drivers/soc/mediatek/mtk-pmic-wrap.c |  4 ++--

For Mediatek:

Acked-by on v1 1/1
#4 lore raw
In reply to Rob Herring
Quoted 18 lines · Rob Herring

Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node.

Cc Scott Wood <[email protected]>
Cc Qiang Zhao <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc Simon Horman <[email protected]>
Cc Magnus Damm <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Cc linuxppc-dev at lists.ozlabs.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-mediatek at lists.infradead.org
Cc linux-renesas-soc at vger.kernel.org
Cc linux-samsung-soc at vger.kernel.org
Quoted 11 lines
---
 drivers/soc/fsl/qbman/bman_ccsr.c    | 10 +++++-----
 drivers/soc/fsl/qbman/bman_portal.c  |  8 +++-----
 drivers/soc/fsl/qbman/qman_ccsr.c    | 12 ++++++------
 drivers/soc/fsl/qbman/qman_portal.c  | 11 ++++-------
 drivers/soc/fsl/qe/gpio.c            |  4 ++--
 drivers/soc/mediatek/mtk-pmic-wrap.c |  4 ++--
 drivers/soc/renesas/rcar-rst.c       |  4 ++--
 drivers/soc/renesas/rcar-sysc.c      |  6 +++---
 drivers/soc/samsung/pm_domains.c     |  8 ++++----
 9 files changed, 31 insertions(+), 36 deletions(-)

Renesas portions:

#5 lore raw
In reply to Rob Herring
Quoted 18 lines · Rob Herring

Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node.

Cc Scott Wood <[email protected]>
Cc Qiang Zhao <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc Simon Horman <[email protected]>
Cc Magnus Damm <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Cc linuxppc-dev at lists.ozlabs.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-mediatek at lists.infradead.org
Cc linux-renesas-soc at vger.kernel.org
Cc linux-samsung-soc at vger.kernel.org
Quoted 11 lines
---
 drivers/soc/fsl/qbman/bman_ccsr.c    | 10 +++++-----
 drivers/soc/fsl/qbman/bman_portal.c  |  8 +++-----
 drivers/soc/fsl/qbman/qman_ccsr.c    | 12 ++++++------
 drivers/soc/fsl/qbman/qman_portal.c  | 11 ++++-------
 drivers/soc/fsl/qe/gpio.c            |  4 ++--
 drivers/soc/mediatek/mtk-pmic-wrap.c |  4 ++--
 drivers/soc/renesas/rcar-rst.c       |  4 ++--
 drivers/soc/renesas/rcar-sysc.c      |  6 +++---
 drivers/soc/samsung/pm_domains.c     |  8 ++++----
 9 files changed, 31 insertions(+), 36 deletions(-)

Arnd, Olof,

Can you please apply this one.

Rob

#6 lore raw
Quoted 15 lines · Rob Herring
Quoted 4 lines · Rob Herring

Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node.

Quoted 9 lines
Cc Scott Wood <[email protected]>
Cc Qiang Zhao <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc Simon Horman <[email protected]>
Cc Magnus Damm <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Quoted 3 lines

Arnd, Olof,

Can you please apply this one.

Applied to next/drivers with the various Acks, thanks!

Arnd