net: stmmac: selftests: Do not fail if PHY is not attached

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>
This commit is contained in:
Jose Abreu 2020-03-09 09:36:20 +01:00 committed by David S. Miller
parent 6c9ee30693
commit e0fa433db2

View 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)