netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: Fix stmmac_mdio_unregister() build errors
@ 2023-06-07  9:34 Feiyang Chen
  2023-06-07 11:55 ` Maciej Fijalkowski
  2023-06-07 13:48 ` Maxime Chevallier
  0 siblings, 2 replies; 5+ messages in thread
From: Feiyang Chen @ 2023-06-07  9:34 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu, maxime.chevallier
  Cc: Feiyang Chen, netdev, loongson-kernel, chris.chenfeiyang,
	Yanteng Si

When CONFIG_PCS_LYNX is not set, lynx_pcs_destroy() will not be
exported. Add #ifdef CONFIG_PCS_LYNX around that code to avoid
build errors like these:

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

Reported-by: Yanteng Si <siyanteng@loongson.cn>
Fixes: 5d1f3fe7d2d5 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver")
Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index c784a6731f08..c1a23846a01c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -665,8 +665,10 @@ int stmmac_mdio_unregister(struct net_device *ndev)
 	if (priv->hw->xpcs)
 		xpcs_destroy(priv->hw->xpcs);
 
+#ifdef CONFIG_PCS_LYNX
 	if (priv->hw->lynx_pcs)
 		lynx_pcs_destroy(priv->hw->lynx_pcs);
+#endif
 
 	mdiobus_unregister(priv->mii);
 	priv->mii->priv = NULL;
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-07 15:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-07  9:34 [PATCH] net: stmmac: Fix stmmac_mdio_unregister() build errors Feiyang Chen
2023-06-07 11:55 ` Maciej Fijalkowski
2023-06-07 14:02   ` Maxime Chevallier
2023-06-07 15:34     ` Simon Horman
2023-06-07 13:48 ` Maxime Chevallier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).