[PATCH] net: stmmac: Fix build without PCS_LYNX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If STMMAC_ETH=y, but PCS_LYNX=n (e.g. shmobile_defconfig):

    arm-linux-gnueabihf-ld: drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.o: in function `stmmac_mdio_unregister':
    stmmac_mdio.c:(.text+0xfbc): undefined reference to `lynx_pcs_destroy'

As pcs_lynx is used only on dwmac_socfpga, fix this by adding a check
for PCS_LYNX to the cleanup path in the generic driver.

Fixes: 5d1f3fe7d2d54d04 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index c784a6731f08e108..53ed59d732210814 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -665,7 +665,7 @@ int stmmac_mdio_unregister(struct net_device *ndev)
 	if (priv->hw->xpcs)
 		xpcs_destroy(priv->hw->xpcs);
 
-	if (priv->hw->lynx_pcs)
+	if (IS_ENABLED(CONFIG_PCS_LYNX) && priv->hw->lynx_pcs)
 		lynx_pcs_destroy(priv->hw->lynx_pcs);
 
 	mdiobus_unregister(priv->mii);
-- 
2.34.1




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux