aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ibm/emac
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2017-07-18 16:43:19 -0500
committerDavid S. Miller <davem@davemloft.net>2017-07-24 13:41:48 -0700
commitf7ce91038d52780060ccb0d7ee6dd48967b3e132 (patch)
treee947e070a78d3c469617d6bdaf5d37764c256411 /drivers/net/ethernet/ibm/emac
parentMerge branch 'virtio_net-xdp-refine' (diff)
downloadlinux-dev-f7ce91038d52780060ccb0d7ee6dd48967b3e132.tar.xz
linux-dev-f7ce91038d52780060ccb0d7ee6dd48967b3e132.zip
net: 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. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ibm/emac')
-rw-r--r--drivers/net/ethernet/ibm/emac/core.c53
-rw-r--r--drivers/net/ethernet/ibm/emac/debug.h2
-rw-r--r--drivers/net/ethernet/ibm/emac/mal.c8
-rw-r--r--drivers/net/ethernet/ibm/emac/rgmii.c18
-rw-r--r--drivers/net/ethernet/ibm/emac/tah.c12
-rw-r--r--drivers/net/ethernet/ibm/emac/zmii.c17
6 files changed, 47 insertions, 63 deletions
diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
index 259e69a52ec5..95135d20458f 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
@@ -133,8 +133,7 @@ static inline void emac_report_timeout_error(struct emac_instance *dev,
EMAC_FTR_440EP_PHY_CLK_FIX))
DBG(dev, "%s" NL, error);
else if (net_ratelimit())
- printk(KERN_ERR "%s: %s\n", dev->ofdev->dev.of_node->full_name,
- error);
+ printk(KERN_ERR "%pOF: %s\n", dev->ofdev->dev.of_node, error);
}
/* EMAC PHY clock workaround:
@@ -2258,8 +2257,8 @@ static void emac_ethtool_get_drvinfo(struct net_device *ndev,
strlcpy(info->driver, "ibm_emac", sizeof(info->driver));
strlcpy(info->version, DRV_VERSION, sizeof(info->version));
- snprintf(info->bus_info, sizeof(info->bus_info), "PPC 4xx EMAC-%d %s",
- dev->cell_index, dev->ofdev->dev.of_node->full_name);
+ snprintf(info->bus_info, sizeof(info->bus_info), "PPC 4xx EMAC-%d %pOF",
+ dev->cell_index, dev->ofdev->dev.of_node);
}
static const struct ethtool_ops emac_ethtool_ops = {
@@ -2431,8 +2430,8 @@ static int emac_read_uint_prop(struct device_node *np, const char *name,
const u32 *prop = of_get_property(np, name, &len);
if (prop == NULL || len < sizeof(u32)) {
if (fatal)
- printk(KERN_ERR "%s: missing %s property\n",
- np->full_name, name);
+ printk(KERN_ERR "%pOF: missing %s property\n",
+ np, name);
return -ENODEV;
}
*val = *prop;
@@ -2768,7 +2767,7 @@ static int emac_init_phy(struct emac_instance *dev)
#endif
mutex_unlock(&emac_phy_map_lock);
if (i == 0x20) {
- printk(KERN_WARNING "%s: can't find PHY!\n", np->full_name);
+ printk(KERN_WARNING "%pOF: can't find PHY!\n", np);
return -ENXIO;
}
@@ -2894,8 +2893,8 @@ static int emac_init_config(struct emac_instance *dev)
#ifdef CONFIG_IBM_EMAC_NO_FLOW_CTRL
dev->features |= EMAC_FTR_NO_FLOW_CONTROL_40x;
#else
- printk(KERN_ERR "%s: Flow control not disabled!\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: Flow control not disabled!\n",
+ np);
return -ENXIO;
#endif
}
@@ -2918,8 +2917,7 @@ static int emac_init_config(struct emac_instance *dev)
#ifdef CONFIG_IBM_EMAC_TAH
dev->features |= EMAC_FTR_HAS_TAH;
#else
- printk(KERN_ERR "%s: TAH support not enabled !\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: TAH support not enabled !\n", np);
return -ENXIO;
#endif
}
@@ -2928,8 +2926,7 @@ static int emac_init_config(struct emac_instance *dev)
#ifdef CONFIG_IBM_EMAC_ZMII
dev->features |= EMAC_FTR_HAS_ZMII;
#else
- printk(KERN_ERR "%s: ZMII support not enabled !\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: ZMII support not enabled !\n", np);
return -ENXIO;
#endif
}
@@ -2938,8 +2935,7 @@ static int emac_init_config(struct emac_instance *dev)
#ifdef CONFIG_IBM_EMAC_RGMII
dev->features |= EMAC_FTR_HAS_RGMII;
#else
- printk(KERN_ERR "%s: RGMII support not enabled !\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: RGMII support not enabled !\n", np);
return -ENXIO;
#endif
}
@@ -2947,8 +2943,8 @@ static int emac_init_config(struct emac_instance *dev)
/* Read MAC-address */
p = of_get_property(np, "local-mac-address", NULL);
if (p == NULL) {
- printk(KERN_ERR "%s: Can't find local-mac-address property\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: Can't find local-mac-address property\n",
+ np);
return -ENXIO;
}
memcpy(dev->ndev->dev_addr, p, ETH_ALEN);
@@ -3043,23 +3039,21 @@ static int emac_probe(struct platform_device *ofdev)
dev->emac_irq = irq_of_parse_and_map(np, 0);
dev->wol_irq = irq_of_parse_and_map(np, 1);
if (!dev->emac_irq) {
- printk(KERN_ERR "%s: Can't map main interrupt\n", np->full_name);
+ printk(KERN_ERR "%pOF: Can't map main interrupt\n", np);
goto err_free;
}
ndev->irq = dev->emac_irq;
/* Map EMAC regs */
if (of_address_to_resource(np, 0, &dev->rsrc_regs)) {
- printk(KERN_ERR "%s: Can't get registers address\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: Can't get registers address\n", np);
goto err_irq_unmap;
}
// TODO : request_mem_region
dev->emacp = ioremap(dev->rsrc_regs.start,
resource_size(&dev->rsrc_regs));
if (dev->emacp == NULL) {
- printk(KERN_ERR "%s: Can't map device registers!\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: Can't map device registers!\n", np);
err = -ENOMEM;
goto err_irq_unmap;
}
@@ -3068,8 +3062,7 @@ static int emac_probe(struct platform_device *ofdev)
err = emac_wait_deps(dev);
if (err) {
printk(KERN_ERR
- "%s: Timeout waiting for dependent devices\n",
- np->full_name);
+ "%pOF: Timeout waiting for dependent devices\n", np);
/* display more info about what's missing ? */
goto err_reg_unmap;
}
@@ -3084,8 +3077,8 @@ static int emac_probe(struct platform_device *ofdev)
dev->commac.rx_chan_mask = MAL_CHAN_MASK(dev->mal_rx_chan);
err = mal_register_commac(dev->mal, &dev->commac);
if (err) {
- printk(KERN_ERR "%s: failed to register with mal %s!\n",
- np->full_name, dev->mal_dev->dev.of_node->full_name);
+ printk(KERN_ERR "%pOF: failed to register with mal %pOF!\n",
+ np, dev->mal_dev->dev.of_node);
goto err_rel_deps;
}
dev->rx_skb_size = emac_rx_skb_size(ndev->mtu);
@@ -3161,8 +3154,8 @@ static int emac_probe(struct platform_device *ofdev)
err = register_netdev(ndev);
if (err) {
- printk(KERN_ERR "%s: failed to register net device (%d)!\n",
- np->full_name, err);
+ printk(KERN_ERR "%pOF: failed to register net device (%d)!\n",
+ np, err);
goto err_detach_tah;
}
@@ -3176,8 +3169,8 @@ static int emac_probe(struct platform_device *ofdev)
wake_up_all(&emac_probe_wait);
- printk(KERN_INFO "%s: EMAC-%d %s, MAC %pM\n",
- ndev->name, dev->cell_index, np->full_name, ndev->dev_addr);
+ printk(KERN_INFO "%s: EMAC-%d %pOF, MAC %pM\n",
+ ndev->name, dev->cell_index, np, ndev->dev_addr);
if (dev->phy_mode == PHY_MODE_SGMII)
printk(KERN_NOTICE "%s: in SGMII mode\n", ndev->name);
diff --git a/drivers/net/ethernet/ibm/emac/debug.h b/drivers/net/ethernet/ibm/emac/debug.h
index 5bdfc174a07e..9d06d3be3161 100644
--- a/drivers/net/ethernet/ibm/emac/debug.h
+++ b/drivers/net/ethernet/ibm/emac/debug.h
@@ -31,7 +31,7 @@
#endif
#define EMAC_DBG(d, name, fmt, arg...) \
- printk(KERN_DEBUG #name "%s: " fmt, d->ofdev->dev.of_node->full_name, ## arg)
+ printk(KERN_DEBUG #name "%pOF: " fmt, d->ofdev->dev.of_node, ## arg)
#if DBG_LEVEL > 0
# define DBG(d,f,x...) EMAC_DBG(d, emac, f, ##x)
diff --git a/drivers/net/ethernet/ibm/emac/mal.c b/drivers/net/ethernet/ibm/emac/mal.c
index 91b1a558f37d..2c74baa2398a 100644
--- a/drivers/net/ethernet/ibm/emac/mal.c
+++ b/drivers/net/ethernet/ibm/emac/mal.c
@@ -579,8 +579,8 @@ static int mal_probe(struct platform_device *ofdev)
mal->features |= (MAL_FTR_CLEAR_ICINTSTAT |
MAL_FTR_COMMON_ERR_INT);
#else
- printk(KERN_ERR "%s: Support for 405EZ not enabled!\n",
- ofdev->dev.of_node->full_name);
+ printk(KERN_ERR "%pOF: Support for 405EZ not enabled!\n",
+ ofdev->dev.of_node);
err = -ENODEV;
goto fail;
#endif
@@ -687,8 +687,8 @@ static int mal_probe(struct platform_device *ofdev)
mal_enable_eob_irq(mal);
printk(KERN_INFO
- "MAL v%d %s, %d TX channels, %d RX channels\n",
- mal->version, ofdev->dev.of_node->full_name,
+ "MAL v%d %pOF, %d TX channels, %d RX channels\n",
+ mal->version, ofdev->dev.of_node,
mal->num_tx_chans, mal->num_rx_chans);
/* Advertise this instance to the rest of the world */
diff --git a/drivers/net/ethernet/ibm/emac/rgmii.c b/drivers/net/ethernet/ibm/emac/rgmii.c
index 206ccbbae7bb..c4a1ac38bba8 100644
--- a/drivers/net/ethernet/ibm/emac/rgmii.c
+++ b/drivers/net/ethernet/ibm/emac/rgmii.c
@@ -104,8 +104,8 @@ int rgmii_attach(struct platform_device *ofdev, int input, int mode)
/* Check if we need to attach to a RGMII */
if (input < 0 || !rgmii_valid_mode(mode)) {
- printk(KERN_ERR "%s: unsupported settings !\n",
- ofdev->dev.of_node->full_name);
+ printk(KERN_ERR "%pOF: unsupported settings !\n",
+ ofdev->dev.of_node);
return -ENODEV;
}
@@ -114,8 +114,8 @@ int rgmii_attach(struct platform_device *ofdev, int input, int mode)
/* Enable this input */
out_be32(&p->fer, in_be32(&p->fer) | rgmii_mode_mask(mode, input));
- printk(KERN_NOTICE "%s: input %d in %s mode\n",
- ofdev->dev.of_node->full_name, input, rgmii_mode_name(mode));
+ printk(KERN_NOTICE "%pOF: input %d in %s mode\n",
+ ofdev->dev.of_node, input, rgmii_mode_name(mode));
++dev->users;
@@ -249,8 +249,7 @@ static int rgmii_probe(struct platform_device *ofdev)
rc = -ENXIO;
if (of_address_to_resource(np, 0, &regs)) {
- printk(KERN_ERR "%s: Can't get registers address\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: Can't get registers address\n", np);
goto err_free;
}
@@ -258,8 +257,7 @@ static int rgmii_probe(struct platform_device *ofdev)
dev->base = (struct rgmii_regs __iomem *)ioremap(regs.start,
sizeof(struct rgmii_regs));
if (dev->base == NULL) {
- printk(KERN_ERR "%s: Can't map device registers!\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: Can't map device registers!\n", np);
goto err_free;
}
@@ -278,8 +276,8 @@ static int rgmii_probe(struct platform_device *ofdev)
out_be32(&dev->base->fer, 0);
printk(KERN_INFO
- "RGMII %s initialized with%s MDIO support\n",
- ofdev->dev.of_node->full_name,
+ "RGMII %pOF initialized with%s MDIO support\n",
+ ofdev->dev.of_node,
(dev->flags & EMAC_RGMII_FLAG_HAS_MDIO) ? "" : "out");
wmb();
diff --git a/drivers/net/ethernet/ibm/emac/tah.c b/drivers/net/ethernet/ibm/emac/tah.c
index 32cb6c9007c5..9912456dca48 100644
--- a/drivers/net/ethernet/ibm/emac/tah.c
+++ b/drivers/net/ethernet/ibm/emac/tah.c
@@ -58,8 +58,7 @@ void tah_reset(struct platform_device *ofdev)
--n;
if (unlikely(!n))
- printk(KERN_ERR "%s: reset timeout\n",
- ofdev->dev.of_node->full_name);
+ printk(KERN_ERR "%pOF: reset timeout\n", ofdev->dev.of_node);
/* 10KB TAH TX FIFO accommodates the max MTU of 9000 */
out_be32(&p->mr,
@@ -105,8 +104,7 @@ static int tah_probe(struct platform_device *ofdev)
rc = -ENXIO;
if (of_address_to_resource(np, 0, &regs)) {
- printk(KERN_ERR "%s: Can't get registers address\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: Can't get registers address\n", np);
goto err_free;
}
@@ -114,8 +112,7 @@ static int tah_probe(struct platform_device *ofdev)
dev->base = (struct tah_regs __iomem *)ioremap(regs.start,
sizeof(struct tah_regs));
if (dev->base == NULL) {
- printk(KERN_ERR "%s: Can't map device registers!\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: Can't map device registers!\n", np);
goto err_free;
}
@@ -124,8 +121,7 @@ static int tah_probe(struct platform_device *ofdev)
/* Initialize TAH and enable IPv4 checksum verification, no TSO yet */
tah_reset(ofdev);
- printk(KERN_INFO
- "TAH %s initialized\n", ofdev->dev.of_node->full_name);
+ printk(KERN_INFO "TAH %pOF initialized\n", ofdev->dev.of_node);
wmb();
return 0;
diff --git a/drivers/net/ethernet/ibm/emac/zmii.c b/drivers/net/ethernet/ibm/emac/zmii.c
index 8727b865ea02..89c42d362292 100644
--- a/drivers/net/ethernet/ibm/emac/zmii.c
+++ b/drivers/net/ethernet/ibm/emac/zmii.c
@@ -121,15 +121,15 @@ int zmii_attach(struct platform_device *ofdev, int input, int *mode)
} else
dev->mode = *mode;
- printk(KERN_NOTICE "%s: bridge in %s mode\n",
- ofdev->dev.of_node->full_name,
+ printk(KERN_NOTICE "%pOF: bridge in %s mode\n",
+ ofdev->dev.of_node,
zmii_mode_name(dev->mode));
} else {
/* All inputs must use the same mode */
if (*mode != PHY_MODE_NA && *mode != dev->mode) {
printk(KERN_ERR
- "%s: invalid mode %d specified for input %d\n",
- ofdev->dev.of_node->full_name, *mode, input);
+ "%pOF: invalid mode %d specified for input %d\n",
+ ofdev->dev.of_node, *mode, input);
mutex_unlock(&dev->lock);
return -EINVAL;
}
@@ -250,8 +250,7 @@ static int zmii_probe(struct platform_device *ofdev)
rc = -ENXIO;
if (of_address_to_resource(np, 0, &regs)) {
- printk(KERN_ERR "%s: Can't get registers address\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: Can't get registers address\n", np);
goto err_free;
}
@@ -259,8 +258,7 @@ static int zmii_probe(struct platform_device *ofdev)
dev->base = (struct zmii_regs __iomem *)ioremap(regs.start,
sizeof(struct zmii_regs));
if (dev->base == NULL) {
- printk(KERN_ERR "%s: Can't map device registers!\n",
- np->full_name);
+ printk(KERN_ERR "%pOF: Can't map device registers!\n", np);
goto err_free;
}
@@ -270,8 +268,7 @@ static int zmii_probe(struct platform_device *ofdev)
/* Disable all inputs by default */
out_be32(&dev->base->fer, 0);
- printk(KERN_INFO
- "ZMII %s initialized\n", ofdev->dev.of_node->full_name);
+ printk(KERN_INFO "ZMII %pOF initialized\n", ofdev->dev.of_node);
wmb();
platform_set_drvdata(ofdev, dev);