Skip to content

Commit 42e8702

Browse files
joabreudavem330
authored andcommitted
net: stmmac: Fix case when PHY handle is not present
Some DT bindings do not have the PHY handle. Let's fallback to manually discovery in case phylink_of_phy_connect() fails. Changes from v1: - Fixup comment style (Sergei) Fixes: 7437127 ("net: stmmac: Convert to phylink and remove phylib logic") Reported-by: Katsuhiro Suzuki <[email protected]> Tested-by: Katsuhiro Suzuki <[email protected]> Signed-off-by: Jose Abreu <[email protected]> Cc: Joao Pinto <[email protected]> Cc: David S. Miller <[email protected]> Cc: Giuseppe Cavallaro <[email protected]> Cc: Alexandre Torgue <[email protected]> Cc: Sergei Shtylyov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ee7dd77 commit 42e8702

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -953,9 +953,13 @@ static int stmmac_init_phy(struct net_device *dev)
953953

954954
node = priv->plat->phylink_node;
955955

956-
if (node) {
956+
if (node)
957957
ret = phylink_of_phy_connect(priv->phylink, node, 0);
958-
} else {
958+
959+
/* Some DT bindings do not set-up the PHY handle. Let's try to
960+
* manually parse it
961+
*/
962+
if (!node || ret) {
959963
int addr = priv->plat->phy_addr;
960964
struct phy_device *phydev;
961965

0 commit comments

Comments
 (0)