netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: Feiyang Chen <chenfeiyang@loongson.cn>, <peppe.cavallaro@st.com>,
	<alexandre.torgue@foss.st.com>, <joabreu@synopsys.com>,
	<netdev@vger.kernel.org>, <loongson-kernel@lists.loongnix.cn>,
	<chris.chenfeiyang@gmail.com>, Yanteng Si <siyanteng@loongson.cn>
Subject: Re: [PATCH] net: stmmac: Fix stmmac_mdio_unregister() build errors
Date: Wed, 7 Jun 2023 16:02:19 +0200	[thread overview]
Message-ID: <20230607160219.7dd5e867@pc-7.home> (raw)
In-Reply-To: <ZIBwPc95jooavl86@boxer>

Hello,

On Wed, 7 Jun 2023 13:55:41 +0200
Maciej Fijalkowski <maciej.fijalkowski@intel.com> wrote:

> On Wed, Jun 07, 2023 at 05:34:40PM +0800, Feiyang Chen 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'
> > 
> > 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  
> 
> wouldn't it be better to provide a stub of lynx_pcs_destroy() for
> !CONFIG_PCS_LYNX ? otherwise all of the users will have to surrounded with
> this ifdef.

I just sent another fix that has been in the works since yesterday :

https://lore.kernel.org/netdev/20230607135941.407054-1-maxime.chevallier@bootlin.com/T/#t

It uses a better solution of only using pcs_lynx-related helpers on dwmac_socfpga,
as this is the only stmmac variant that needs this PCS.

Sorry for the mess,

Maxime

> >  	if (priv->hw->lynx_pcs)
> >  		lynx_pcs_destroy(priv->hw->lynx_pcs);
> > +#endif
> >  
> >  	mdiobus_unregister(priv->mii);
> >  	priv->mii->priv = NULL;
> > -- 
> > 2.39.3
> > 
> >   


  reply	other threads:[~2023-06-07 12:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2023-06-07 15:34     ` Simon Horman
2023-06-07 13:48 ` Maxime Chevallier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230607160219.7dd5e867@pc-7.home \
    --to=maxime.chevallier@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=chenfeiyang@loongson.cn \
    --cc=chris.chenfeiyang@gmail.com \
    --cc=joabreu@synopsys.com \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=maciej.fijalkowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=siyanteng@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).