summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-09-17 12:56:50 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-09-18 07:39:25 +0200
commitcbaa414e7c4d5296c87329b161bdc2cb09c9f70b (patch)
tree3f1d5a3c2139a375847ad9d58d032c25617580bb
parent1c1292a1393996ce32aa59170c151acfe29d2784 (diff)
downloadbarebox-cbaa414e7c4d5296c87329b161bdc2cb09c9f70b.tar.gz
barebox-cbaa414e7c4d5296c87329b161bdc2cb09c9f70b.tar.xz
net: mdio: Do not warn about invalid PHY address
of_mdiobus_register is now called with nodes from ethernet devices. Their child nodes are not necessarily phy nodes. For am335x devices we get several warnings now: miibus0: /ocp/ethernet@4a100000/mdio@4a101000 PHY address 1242566656 is too large miibus0: /ocp/ethernet@4a100000/slave@4a100200 has invalid PHY address miibus0: /ocp/ethernet@4a100000/slave@4a100300 has invalid PHY address miibus0: /ocp/ethernet@4a100000/cpsw-phy-sel@44e10650 PHY address 1155597904 is too large None of the nodes is a phy node, so silence the warnings and turn them into dev_dbg. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/net/phy/mdio_bus.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 02e47f6a14..7d53bcc3da 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -179,9 +179,12 @@ static int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
/* Loop over the child nodes and register a phy_device for each one */
for_each_available_child_of_node(np, child) {
+ if (!of_mdiobus_child_is_phy(child))
+ continue;
+
ret = of_property_read_u32(child, "reg", &addr);
if (ret) {
- dev_err(&mdio->dev, "%s has invalid PHY address\n",
+ dev_dbg(&mdio->dev, "%s has invalid PHY address\n",
child->full_name);
continue;
}
@@ -192,9 +195,6 @@ static int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
continue;
}
- if (!of_mdiobus_child_is_phy(child))
- continue;
-
of_mdiobus_reset_phy(mdio, child);
of_mdiobus_register_phy(mdio, child, addr);
}