diff mbox series

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

Message ID 20180828154433.5693-7-robh@kernel.org
State Accepted
Commit f93861c2d6118f721a34656f3a23dc49400484af
Headers show
Series [v2] staging: Convert to using %pOFn instead of device_node.name | expand

Commit Message

Rob Herring Aug. 28, 2018, 3:44 p.m. UTC
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Cc: Steve Longerbeam <slongerbeam@gmail.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-media@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Signed-off-by: Rob Herring <robh@kernel.org>

---
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(-)

--
2.17.1

Comments

Mauro Carvalho Chehab Sept. 12, 2018, 3:17 p.m. UTC | #1
Em Tue, 28 Aug 2018 10:44:33 -0500
Rob Herring <robh@kernel.org> 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 <slongerbeam@gmail.com>

> Cc: Philipp Zabel <p.zabel@pengutronix.de>

> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>

> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

> Cc: linux-media@vger.kernel.org

> Cc: devel@driverdev.osuosl.org

> Signed-off-by: Rob Herring <robh@kernel.org>

> ---

> 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 <mchehab+samsung@kernel.org>


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
Joe Perches Sept. 13, 2018, 11:50 a.m. UTC | #2
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
Rob Herring Sept. 13, 2018, 9:26 p.m. UTC | #3
On Thu, Sep 13, 2018 at 3:45 PM Joe Perches <joe@perches.com> 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
diff mbox series

Patch

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;