From nobody Tue Feb 10 00:41:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 391C0C77B73 for ; Tue, 6 Jun 2023 08:29:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237150AbjFFI3E (ORCPT ); Tue, 6 Jun 2023 04:29:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237107AbjFFI2q (ORCPT ); Tue, 6 Jun 2023 04:28:46 -0400 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F9BA1BC7 for ; Tue, 6 Jun 2023 01:27:21 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed30:a3e8:6562:a823:d832]) by laurent.telenet-ops.be with bizsmtp id 5kT42A00H1Tjf1k01kT4vb; Tue, 06 Jun 2023 10:27:13 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1q6S1b-004GxN-Ly; Tue, 06 Jun 2023 10:27:04 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1q6S1w-00Awvw-EK; Tue, 06 Jun 2023 10:27:04 +0200 From: Geert Uytterhoeven To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Maxime Chevallier , Simon Horman Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] net: stmmac: Fix build without PCS_LYNX Date: Tue, 6 Jun 2023 10:27:01 +0200 Message-Id: <7b36ac43778b41831debd5c30b5b37d268512195.1686039915.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" If STMMAC_ETH=3Dy, but PCS_LYNX=3Dn (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 driv= er") Signed-off-by: Geert Uytterhoeven --- 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/ne= t/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); =20 - if (priv->hw->lynx_pcs) + if (IS_ENABLED(CONFIG_PCS_LYNX) && priv->hw->lynx_pcs) lynx_pcs_destroy(priv->hw->lynx_pcs); =20 mdiobus_unregister(priv->mii); --=20 2.34.1