Created
June 21, 2021 10:34
-
-
Save lategoodbye/b962e636543803fedd9cc59028fe6b44 to your computer and use it in GitHub Desktop.
net: mdio: Provide an useful error when of_phy_connect fails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 32ab471ccc5d2219e7fb8dac05f807dd832ff47b Mon Sep 17 00:00:00 2001 | |
From: Stefan Wahren <[email protected]> | |
Date: Mon, 21 Jun 2021 12:30:30 +0200 | |
Subject: [PATCH] net: mdio: Provide an useful error when of_phy_connect fails | |
Signed-off-by: Stefan Wahren <[email protected]> | |
--- | |
drivers/net/mdio/of_mdio.c | 8 +++++++- | |
1 file changed, 7 insertions(+), 1 deletion(-) | |
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c | |
index 094494a..07034b5 100644 | |
--- a/drivers/net/mdio/of_mdio.c | |
+++ b/drivers/net/mdio/of_mdio.c | |
@@ -404,13 +404,19 @@ struct phy_device *of_phy_connect(struct net_device *dev, | |
struct phy_device *phy = of_phy_find_device(phy_np); | |
int ret; | |
- if (!phy) | |
+ if (!phy) { | |
+ netdev_err(dev, "Unable to find PHY device\n"); | |
return NULL; | |
+ } | |
phy->dev_flags |= flags; | |
ret = phy_connect_direct(dev, phy, hndlr, iface); | |
+ if (ret) { | |
+ netdev_err(dev, "Unable to connect to PHY device: %d\n", ret); | |
+ } | |
+ | |
/* refcount is held by phy_connect_direct() on success */ | |
put_device(&phy->mdio.dev); | |
-- | |
2.7.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment