[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230607154821.3b3e8807@pc-7.home>
Date: Wed, 7 Jun 2023 15:48:21 +0200
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Feiyang Chen <chenfeiyang@...ngson.cn>
Cc: peppe.cavallaro@...com, alexandre.torgue@...s.st.com,
joabreu@...opsys.com, netdev@...r.kernel.org,
loongson-kernel@...ts.loongnix.cn, chris.chenfeiyang@...il.com, Yanteng Si
<siyanteng@...ngson.cn>
Subject: Re: [PATCH] net: stmmac: Fix stmmac_mdio_unregister() build errors
Hello,
On Wed, 7 Jun 2023 17:34:40 +0800
Feiyang Chen <chenfeiyang@...ngson.cn> wrote:
> 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'
I have sent a series aiming to fix this yesterday [1], which I'll followup today
addressing the last pieces for the fix. Sorry about this,
Maxime
> Reported-by: Yanteng Si <siyanteng@...ngson.cn>
> Fixes: 5d1f3fe7d2d5 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver")
> Signed-off-by: Feiyang Chen <chenfeiyang@...ngson.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;
Powered by blists - more mailing lists