Skip to contentSkip to conversation

ARM: omap: Convert to using %pOFn instead of device_node.name

PATCH In review Rob Herring 63 participants 163 messages Aug 28, 2018 – Oct 8, 2018 Page 2 of 2

Subsystems (121)
lore
Share & tools
lore
#156 lore raw

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

In reply to Mauro Carvalho Chehab

+Joe P

Quoted 18 lines · Mauro Carvalho Chehab

Em Tue, 28 Aug 2018 10:44:33 -0500
Rob Herring <[email protected]> escreveu:

Quoted 14 lines

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]>

---
v2:
- fix conditional use of node name vs devname for imx

Quoted 6 lines
Quoted 3 lines
 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

Quoted 103 lines

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,

If you prefer instead that I would pick the media part, please split it into two patches.

Regards,
Mauro

Quoted 83 lines
 3 files changed, 14 insertions(+), 9 deletions(-)
drivers/staging/media/imx/imx-media-dev.c +10 -5
index b0be80f05767..3f48f5ceb6ea 100644
@@ -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;
drivers/staging/media/imx/imx-media-of.c +2 -2
index acde372c6795..163437e421c5 100644
@@ -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;
      }
drivers/staging/mt7621-eth/mdio.c +2 -3
index 7ad0c4141205..9ffa8f771235 100644
@@ -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;
--
Quoted 1 line

2.17.1

Thanks,
Mauro

#157 lore raw

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:

Quoted 22 lines

+Joe P

Quoted 18 lines · Mauro Carvalho Chehab

Em Tue, 28 Aug 2018 10:44:33 -0500
Rob Herring <[email protected]> escreveu:

Quoted 14 lines

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]>

---
v2:
- fix conditional use of node name vs devname for imx

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
 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.

Quoted 8 lines

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.

Quoted 4 lines

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

#158 lore raw

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

Quoted 39 lines · Mauro Carvalho Chehab

Em Wed, 12 Sep 2018 15:26:48 -0500
Rob Herring <[email protected]> escreveu:

Quoted 22 lines

+Joe P

Quoted 18 lines · Mauro Carvalho Chehab

Em Tue, 28 Aug 2018 10:44:33 -0500
Rob Herring <[email protected]> escreveu:

Quoted 14 lines

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]>

---
v2:
- fix conditional use of node name vs devname for imx

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
 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

Quoted 14 lines
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.

Quoted 2 lines

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.

Quoted 28 lines
Quoted 8 lines

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.

Quoted 4 lines

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)

Quoted 2 lines

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.

Quoted 5 lines

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

#159 lore raw

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

In reply to Rob Herring
Quoted 2 lines · Rob Herring

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

#160 lore raw

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

Quoted 6 lines · Joe Perches
Quoted 2 lines · Rob Herring

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

#17 lore raw

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

In reply to Rob Herring
Quoted 19 lines · CEST Rob Herring

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 linux-arm-kernel at lists.infradead.org
Cc linux-samsung-soc at vger.kernel.org
Cc linux-pm at vger.kernel.org
---
 drivers/cpufreq/s5pv210-cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/s5pv210-cpufreq.c +0 -0
index 5d31c2db12a3..dbecd7667db2 100644

drivers/cpufreq/s5pv210-cpufreq.c static int s5pv210_cpufreq_probe(struct platform_device *pdev) · line 618

Quoted 10 lines
drivers/cpufreq/s5pv210-cpufreq.c +2 -2
@@ -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!

#161 lore raw

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

In reply to Rob Herring
Quoted 10 lines · Rob Herring
Quoted 6 lines · Joe Perches
Quoted 2 lines · Rob Herring

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.

Quoted 2 lines

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.

Quoted 4 lines

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.

#65 lore raw

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

In reply to Will Deacon
Quoted 13 lines · Will Deacon
Quoted 10 lines · Rob Herring

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

Cc Will Deacon <[email protected]>
Cc Mark Rutland <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
---
 drivers/perf/arm_pmu_platform.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 2 lines

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

#111 lore raw

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

In reply to Rob Herring
Quoted 8 lines · Rob Herring

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

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

Quoted 17 lines
drivers/firmware/scpi_pm_domain.c +1 -2
index f395dec27113..390aa13391e4 100644
@@ -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

#120 lore raw

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

In reply to Rob Herring
Quoted 9 lines · Rob Herring

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

---
 drivers/mailbox/ti-msgmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Ping.

Quoted 19 lines
drivers/mailbox/ti-msgmgr.c +2 -3
index 5bceafbf6699..713d701b6568 100644
@@ -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

#41 lore raw

Re: [PATCH] input: sun4i-lradc: Convert to using %pOFn instead of device_node.name

In reply to Rob Herring
Quoted 4 lines · Rob Herring

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

Quoted 8 lines
Cc Hans de Goede <[email protected]>
Cc Dmitry Torokhov <[email protected]>
Cc Maxime Ripard <[email protected]>
---
 drivers/input/keyboard/sun4i-lradc-keys.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Ping.

Quoted 31 lines
drivers/input/keyboard/sun4i-lradc-keys.c +3 -4
index a37c172452e6..57272df34cd5 100644
@@ -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

#127 lore raw

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

In reply to Rob Herring
Quoted 9 lines · Rob Herring

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

Cc Srinivas Kandagatla <[email protected]>
---
 drivers/nvmem/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Ping. This has no dependencies, so please apply.

Rob

Quoted 33 lines
drivers/nvmem/core.c +3 -2
index aa1657831b70..6988ee9f11ba 100644
@@ -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

#95 lore raw

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

In reply to Rob Herring
Quoted 12 lines · Rob Herring

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

Cc 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]>
Quoted 5 lines
---
 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

Quoted 83 lines
drivers/tty/ehv_bytechan.c +6 -6
index eea4049b5dcc..769e0a5d1dfc 100644
@@ -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;
        }
drivers/tty/serial/cpm_uart/cpm_uart_core.c +4 -4
index 24a5f05e769b..ea7204d75022 100644
@@ -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;
drivers/tty/serial/pmac_zilog.c +2 -3
index 3d21790d961e..a4ec22d1f214 100644
@@ -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

#99 lore raw

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

In reply to Rob Herring
Quoted 8 lines · Rob Herring

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

Quoted 10 lines
---
 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!

Quoted 129 lines
drivers/video/fbdev/cg14.c +1 -3
index 8de88b129b62..9af54c2368fd 100644
@@ -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;
drivers/video/fbdev/cg3.c +1 -1
index 6c334260cf53..1bd95b02f3aa 100644
@@ -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;
drivers/video/fbdev/core/fbmon.c +2 -2
index 852d86c1c527..dd3128990776 100644
@@ -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;
drivers/video/fbdev/imsttfb.c +1 -1
index ecdcf358ad5e..901ca4ed10e9 100644
@@ -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");
 
drivers/video/fbdev/leo.c +1 -1
index 71862188f528..446ac3364bad 100644
@@ -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;
drivers/video/fbdev/offb.c +8 -4
index 77c0a2f45b3b..31f769d67195 100644
@@ -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);
        }
drivers/video/fbdev/p9100.c +1 -1
index 64de5cda541d..c4283e9e95af 100644
@@ -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;
drivers/video/of_display_timing.c +1 -2
index 5244e93ceafc..c2e7aa103fa5 100644
@@ -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

#96 lore raw

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

In reply to Rob Herring
Quoted 20 lines · Rob Herring
Quoted 12 lines · Rob Herring

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

Cc 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]>
Quoted 5 lines
---
 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(-)
Quoted 2 lines

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

maintainer Applied
#42 lore raw

Re: [PATCH] input: sun4i-lradc: Convert to using %pOFn instead of device_node.name

In reply to Rob Herring
Quoted 8 lines · Rob Herring

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

Cc Hans de Goede <[email protected]>
Cc Dmitry Torokhov <[email protected]>
Cc Maxime Ripard <[email protected]>

Applied, thank you.

Quoted 34 lines
---
 drivers/input/keyboard/sun4i-lradc-keys.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/input/keyboard/sun4i-lradc-keys.c +3 -3
index a37c172452e6..57272df34cd5 100644
@@ -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;
 		}
 
Signature · 1 line
2.17.1
Signature · 1 line
Dmitry
Acked-by on v1 1/1
#91 lore raw

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

In reply to Rob Herring
Quoted 15 lines · Rob Herring

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

Cc 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 linuxppc-dev at lists.ozlabs.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-soc at vger.kernel.org
Quoted 1 line

---

#128 lore raw

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

In reply to Rob Herring
Quoted 5 lines · Rob Herring
Quoted 4 lines · Rob Herring

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

Quoted 7 lines
Quoted 5 lines
Cc Srinivas Kandagatla <[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

Quoted 36 lines

Rob

Quoted 33 lines
drivers/nvmem/core.c +3 -2
index aa1657831b70..6988ee9f11ba 100644
@@ -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

Acked-by
#112 lore raw

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

In reply to Rob Herring
Quoted 5 lines · Rob Herring
Quoted 4 lines · Rob Herring

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

Quoted 8 lines
Quoted 4 lines
---
 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.

--
Regards,
Sudeep

#66 lore raw

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

In reply to Rob Herring
Quoted 14 lines · Rob Herring
Quoted 13 lines · Will Deacon
Quoted 10 lines · Rob Herring

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

---
 drivers/perf/arm_pmu_platform.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 5 lines
Quoted 2 lines

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

#106 lore raw

Re: powerpc: Convert to using %pOFn instead of device_node.name

In reply to Rob Herring
Quoted 9 lines · Rob Herring

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

Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Arnd Bergmann <[email protected]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/b9ef7b4b867f56114bedbe6bf104cf

cheers

maintainer Applied
#151 lore raw

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

In reply to Rob Herring

From: Rob Herring <[email protected]>
Date: Tue, 28 Aug 2018 10:44:32 -0500

Quoted 9 lines

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

---
v2:
- snprint -> snprintf typo fix

Applied.

#100 lore raw

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

In reply to Rob Herring
Quoted 7 lines · Rob Herring

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

Patch queued for 4.20, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics