net: stmmac: selftests: Do not fail if PHY is not attached
authorJose Abreu <Jose.Abreu@synopsys.com>
Mon, 9 Mar 2020 08:36:20 +0000 (09:36 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Mar 2020 03:13:16 +0000 (20:13 -0700)
If a PHY is not attached, we can still run the tests with MAC loopback
mode. Return -EOPNOTSUPP error code in PHY loopback test so that global
status is not a failure.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c

index 2aba2673d6c3830d8e832f76bce87668cfba8cb1..586a657be9840c77516f111d783951d2104e40ba 100644 (file)
@@ -380,7 +380,7 @@ static int stmmac_test_phy_loopback(struct stmmac_priv *priv)
        int ret;
 
        if (!priv->dev->phydev)
-               return -EBUSY;
+               return -EOPNOTSUPP;
 
        ret = phy_loopback(priv->dev->phydev, true);
        if (ret)