mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH] net: mdio: Do not warn about invalid PHY address
Date: Mon, 17 Sep 2018 13:31:23 +0200	[thread overview]
Message-ID: <20180917113123.3268-1-s.hauer@pengutronix.de> (raw)

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

                 reply	other threads:[~2018-09-17 11:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180917113123.3268-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox