For flow-control testing in loopback mode, we don't need to ask what the PHY is currently using as pause/asym settings. The PHY is no longer involved in selftest, we rely strictly on MAC loopback. We therefore only need to know if the MAC supports Symmetric pause for the test, as we exercise both TX and RX pause support in the selftest. Remove phydev requirement for flowcontrol selftest as well as the AsymPause requirement. With that, we can also drop the linux/phy.h include. Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c index c0e5dee86451..1df26c217f9a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -716,13 +715,13 @@ static int stmmac_test_flowctrl_validate(struct sk_buff *skb, static int stmmac_test_flowctrl(struct stmmac_priv *priv) { unsigned char paddr[ETH_ALEN] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x01}; - struct phy_device *phydev = priv->dev->phydev; u32 rx_cnt = priv->plat->rx_queues_to_use; + struct mac_device_info *mac = priv->hw; struct stmmac_test_priv *tpriv; unsigned int pkt_count; int i, ret = 0; - if (!phydev || (!phydev->pause && !phydev->asym_pause)) + if (!(mac->link.caps & MAC_SYM_PAUSE)) return -EOPNOTSUPP; tpriv = kzalloc_obj(*tpriv); -- 2.55.0