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>
这个提交包含在:
@@ -398,8 +398,8 @@ static struct mac_device *dpaa_mac_dev_get(struct platform_device *pdev)
|
||||
|
||||
of_dev = of_find_device_by_node(mac_node);
|
||||
if (!of_dev) {
|
||||
dev_err(dpaa_dev, "of_find_device_by_node(%s) failed\n",
|
||||
mac_node->full_name);
|
||||
dev_err(dpaa_dev, "of_find_device_by_node(%pOF) failed\n",
|
||||
mac_node);
|
||||
of_node_put(mac_node);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
@@ -960,8 +960,8 @@ static int mpc52xx_fec_probe(struct platform_device *op)
|
||||
|
||||
/* We're done ! */
|
||||
platform_set_drvdata(op, ndev);
|
||||
netdev_info(ndev, "%s MAC %pM\n",
|
||||
op->dev.of_node->full_name, ndev->dev_addr);
|
||||
netdev_info(ndev, "%pOF MAC %pM\n",
|
||||
op->dev.of_node, ndev->dev_addr);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@@ -1925,8 +1925,8 @@ static int fman_reset(struct fman *fman)
|
||||
|
||||
guts_regs = of_iomap(guts_node, 0);
|
||||
if (!guts_regs) {
|
||||
dev_err(fman->dev, "%s: Couldn't map %s regs\n",
|
||||
__func__, guts_node->full_name);
|
||||
dev_err(fman->dev, "%s: Couldn't map %pOF regs\n",
|
||||
__func__, guts_node);
|
||||
goto guts_regs;
|
||||
}
|
||||
#define FMAN1_ALL_MACS_MASK 0xFCC00000
|
||||
@@ -2780,8 +2780,8 @@ static struct fman *read_dts_node(struct platform_device *of_dev)
|
||||
|
||||
err = of_property_read_u32(fm_node, "cell-index", &val);
|
||||
if (err) {
|
||||
dev_err(&of_dev->dev, "%s: failed to read cell-index for %s\n",
|
||||
__func__, fm_node->full_name);
|
||||
dev_err(&of_dev->dev, "%s: failed to read cell-index for %pOF\n",
|
||||
__func__, fm_node);
|
||||
goto fman_node_put;
|
||||
}
|
||||
fman->dts_params.id = (u8)val;
|
||||
@@ -2834,8 +2834,8 @@ static struct fman *read_dts_node(struct platform_device *of_dev)
|
||||
err = of_property_read_u32_array(fm_node, "fsl,qman-channel-range",
|
||||
&range[0], 2);
|
||||
if (err) {
|
||||
dev_err(&of_dev->dev, "%s: failed to read fsl,qman-channel-range for %s\n",
|
||||
__func__, fm_node->full_name);
|
||||
dev_err(&of_dev->dev, "%s: failed to read fsl,qman-channel-range for %pOF\n",
|
||||
__func__, fm_node);
|
||||
goto fman_node_put;
|
||||
}
|
||||
fman->dts_params.qman_channel_base = range[0];
|
||||
|
@@ -1720,8 +1720,8 @@ static int fman_port_probe(struct platform_device *of_dev)
|
||||
|
||||
err = of_property_read_u32(port_node, "cell-index", &val);
|
||||
if (err) {
|
||||
dev_err(port->dev, "%s: reading cell-index for %s failed\n",
|
||||
__func__, port_node->full_name);
|
||||
dev_err(port->dev, "%s: reading cell-index for %pOF failed\n",
|
||||
__func__, port_node);
|
||||
err = -EINVAL;
|
||||
goto return_err;
|
||||
}
|
||||
|
@@ -698,8 +698,8 @@ static int mac_probe(struct platform_device *_of_dev)
|
||||
priv->internal_phy_node = of_parse_phandle(mac_node,
|
||||
"pcsphy-handle", 0);
|
||||
} else {
|
||||
dev_err(dev, "MAC node (%s) contains unsupported MAC\n",
|
||||
mac_node->full_name);
|
||||
dev_err(dev, "MAC node (%pOF) contains unsupported MAC\n",
|
||||
mac_node);
|
||||
err = -EINVAL;
|
||||
goto _return;
|
||||
}
|
||||
@@ -712,16 +712,15 @@ static int mac_probe(struct platform_device *_of_dev)
|
||||
/* Get the FM node */
|
||||
dev_node = of_get_parent(mac_node);
|
||||
if (!dev_node) {
|
||||
dev_err(dev, "of_get_parent(%s) failed\n",
|
||||
mac_node->full_name);
|
||||
dev_err(dev, "of_get_parent(%pOF) failed\n",
|
||||
mac_node);
|
||||
err = -EINVAL;
|
||||
goto _return_dev_set_drvdata;
|
||||
}
|
||||
|
||||
of_dev = of_find_device_by_node(dev_node);
|
||||
if (!of_dev) {
|
||||
dev_err(dev, "of_find_device_by_node(%s) failed\n",
|
||||
dev_node->full_name);
|
||||
dev_err(dev, "of_find_device_by_node(%pOF) failed\n", dev_node);
|
||||
err = -EINVAL;
|
||||
goto _return_of_node_put;
|
||||
}
|
||||
@@ -729,8 +728,7 @@ static int mac_probe(struct platform_device *_of_dev)
|
||||
/* Get the FMan cell-index */
|
||||
err = of_property_read_u32(dev_node, "cell-index", &val);
|
||||
if (err) {
|
||||
dev_err(dev, "failed to read cell-index for %s\n",
|
||||
dev_node->full_name);
|
||||
dev_err(dev, "failed to read cell-index for %pOF\n", dev_node);
|
||||
err = -EINVAL;
|
||||
goto _return_of_node_put;
|
||||
}
|
||||
@@ -739,7 +737,7 @@ static int mac_probe(struct platform_device *_of_dev)
|
||||
|
||||
priv->fman = fman_bind(&of_dev->dev);
|
||||
if (!priv->fman) {
|
||||
dev_err(dev, "fman_bind(%s) failed\n", dev_node->full_name);
|
||||
dev_err(dev, "fman_bind(%pOF) failed\n", dev_node);
|
||||
err = -ENODEV;
|
||||
goto _return_of_node_put;
|
||||
}
|
||||
@@ -749,8 +747,8 @@ static int mac_probe(struct platform_device *_of_dev)
|
||||
/* Get the address of the memory mapped registers */
|
||||
err = of_address_to_resource(mac_node, 0, &res);
|
||||
if (err < 0) {
|
||||
dev_err(dev, "of_address_to_resource(%s) = %d\n",
|
||||
mac_node->full_name, err);
|
||||
dev_err(dev, "of_address_to_resource(%pOF) = %d\n",
|
||||
mac_node, err);
|
||||
goto _return_dev_set_drvdata;
|
||||
}
|
||||
|
||||
@@ -784,8 +782,7 @@ static int mac_probe(struct platform_device *_of_dev)
|
||||
/* Get the cell-index */
|
||||
err = of_property_read_u32(mac_node, "cell-index", &val);
|
||||
if (err) {
|
||||
dev_err(dev, "failed to read cell-index for %s\n",
|
||||
mac_node->full_name);
|
||||
dev_err(dev, "failed to read cell-index for %pOF\n", mac_node);
|
||||
err = -EINVAL;
|
||||
goto _return_dev_set_drvdata;
|
||||
}
|
||||
@@ -794,8 +791,7 @@ static int mac_probe(struct platform_device *_of_dev)
|
||||
/* Get the MAC address */
|
||||
mac_addr = of_get_mac_address(mac_node);
|
||||
if (!mac_addr) {
|
||||
dev_err(dev, "of_get_mac_address(%s) failed\n",
|
||||
mac_node->full_name);
|
||||
dev_err(dev, "of_get_mac_address(%pOF) failed\n", mac_node);
|
||||
err = -EINVAL;
|
||||
goto _return_dev_set_drvdata;
|
||||
}
|
||||
@@ -804,15 +800,15 @@ static int mac_probe(struct platform_device *_of_dev)
|
||||
/* Get the port handles */
|
||||
nph = of_count_phandle_with_args(mac_node, "fsl,fman-ports", NULL);
|
||||
if (unlikely(nph < 0)) {
|
||||
dev_err(dev, "of_count_phandle_with_args(%s, fsl,fman-ports) failed\n",
|
||||
mac_node->full_name);
|
||||
dev_err(dev, "of_count_phandle_with_args(%pOF, fsl,fman-ports) failed\n",
|
||||
mac_node);
|
||||
err = nph;
|
||||
goto _return_dev_set_drvdata;
|
||||
}
|
||||
|
||||
if (nph != ARRAY_SIZE(mac_dev->port)) {
|
||||
dev_err(dev, "Not supported number of fman-ports handles of mac node %s from device tree\n",
|
||||
mac_node->full_name);
|
||||
dev_err(dev, "Not supported number of fman-ports handles of mac node %pOF from device tree\n",
|
||||
mac_node);
|
||||
err = -EINVAL;
|
||||
goto _return_dev_set_drvdata;
|
||||
}
|
||||
@@ -821,24 +817,24 @@ static int mac_probe(struct platform_device *_of_dev)
|
||||
/* Find the port node */
|
||||
dev_node = of_parse_phandle(mac_node, "fsl,fman-ports", i);
|
||||
if (!dev_node) {
|
||||
dev_err(dev, "of_parse_phandle(%s, fsl,fman-ports) failed\n",
|
||||
mac_node->full_name);
|
||||
dev_err(dev, "of_parse_phandle(%pOF, fsl,fman-ports) failed\n",
|
||||
mac_node);
|
||||
err = -EINVAL;
|
||||
goto _return_of_node_put;
|
||||
}
|
||||
|
||||
of_dev = of_find_device_by_node(dev_node);
|
||||
if (!of_dev) {
|
||||
dev_err(dev, "of_find_device_by_node(%s) failed\n",
|
||||
dev_node->full_name);
|
||||
dev_err(dev, "of_find_device_by_node(%pOF) failed\n",
|
||||
dev_node);
|
||||
err = -EINVAL;
|
||||
goto _return_of_node_put;
|
||||
}
|
||||
|
||||
mac_dev->port[i] = fman_port_bind(&of_dev->dev);
|
||||
if (!mac_dev->port[i]) {
|
||||
dev_err(dev, "dev_get_drvdata(%s) failed\n",
|
||||
dev_node->full_name);
|
||||
dev_err(dev, "dev_get_drvdata(%pOF) failed\n",
|
||||
dev_node);
|
||||
err = -EINVAL;
|
||||
goto _return_of_node_put;
|
||||
}
|
||||
@@ -849,8 +845,8 @@ static int mac_probe(struct platform_device *_of_dev)
|
||||
phy_if = of_get_phy_mode(mac_node);
|
||||
if (phy_if < 0) {
|
||||
dev_warn(dev,
|
||||
"of_get_phy_mode() for %s failed. Defaulting to SGMII\n",
|
||||
mac_node->full_name);
|
||||
"of_get_phy_mode() for %pOF failed. Defaulting to SGMII\n",
|
||||
mac_node);
|
||||
phy_if = PHY_INTERFACE_MODE_SGMII;
|
||||
}
|
||||
priv->phy_if = phy_if;
|
||||
|
@@ -267,8 +267,8 @@ static void ucc_configure(phys_addr_t start, phys_addr_t end)
|
||||
|
||||
ret = of_address_to_resource(np, 0, &res);
|
||||
if (ret < 0) {
|
||||
pr_debug("fsl-pq-mdio: no address range in node %s\n",
|
||||
np->full_name);
|
||||
pr_debug("fsl-pq-mdio: no address range in node %pOF\n",
|
||||
np);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -280,8 +280,8 @@ static void ucc_configure(phys_addr_t start, phys_addr_t end)
|
||||
if (!iprop) {
|
||||
iprop = of_get_property(np, "device-id", NULL);
|
||||
if (!iprop) {
|
||||
pr_debug("fsl-pq-mdio: no UCC ID in node %s\n",
|
||||
np->full_name);
|
||||
pr_debug("fsl-pq-mdio: no UCC ID in node %pOF\n",
|
||||
np);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -293,8 +293,8 @@ static void ucc_configure(phys_addr_t start, phys_addr_t end)
|
||||
* numbered from 1, not 0.
|
||||
*/
|
||||
if (ucc_set_qe_mux_mii_mng(id - 1) < 0) {
|
||||
pr_debug("fsl-pq-mdio: invalid UCC ID in node %s\n",
|
||||
np->full_name);
|
||||
pr_debug("fsl-pq-mdio: invalid UCC ID in node %pOF\n",
|
||||
np);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -442,8 +442,8 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev)
|
||||
if (data->get_tbipa) {
|
||||
for_each_child_of_node(np, tbi) {
|
||||
if (strcmp(tbi->type, "tbi-phy") == 0) {
|
||||
dev_dbg(&pdev->dev, "found TBI PHY node %s\n",
|
||||
strrchr(tbi->full_name, '/') + 1);
|
||||
dev_dbg(&pdev->dev, "found TBI PHY node %pOFP\n",
|
||||
tbi);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -454,8 +454,8 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev)
|
||||
|
||||
if (!prop) {
|
||||
dev_err(&pdev->dev,
|
||||
"missing 'reg' property in node %s\n",
|
||||
tbi->full_name);
|
||||
"missing 'reg' property in node %pOF\n",
|
||||
tbi);
|
||||
err = -EBUSY;
|
||||
goto error;
|
||||
}
|
||||
|
在新工单中引用
屏蔽一个用户