mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] net: mdio: Do not warn about invalid PHY address
@ 2018-09-17 11:31 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2018-09-17 11:31 UTC (permalink / raw)
  To: Barebox List; +Cc: Sam Ravnborg

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>
---
 drivers/net/phy/mdio_bus.c | 8 ++++----
 1 file 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);
 	}
-- 
2.19.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-09-17 11:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-17 11:31 [PATCH] net: mdio: Do not warn about invalid PHY address Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox