Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9558df3a authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller
Browse files

net: fec: Issue error for missing but expected PHY



If the PHY is missing but expected, e.g. because of a typ0 in the dt
file, it is not possible to open the interface. ip link returns:

RTNETLINK answers: No such device

It is not very obvious what the problem is. Add a netdev_err() in this
case to make it easier to debug the issue.

[   21.409385] fec 2188000.ethernet eth0: Unable to connect to phy
RTNETLINK answers: No such device

Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Acked-by: default avatarFugang Duan <fugang.duan@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 509394e8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1904,8 +1904,10 @@ static int fec_enet_mii_probe(struct net_device *ndev)
		phy_dev = of_phy_connect(ndev, fep->phy_node,
					 &fec_enet_adjust_link, 0,
					 fep->phy_interface);
		if (!phy_dev)
		if (!phy_dev) {
			netdev_err(ndev, "Unable to connect to phy\n");
			return -ENODEV;
		}
	} else {
		/* check for attached phy */
		for (phy_id = 0; (phy_id < PHY_MAX_ADDR); phy_id++) {