From patchwork Wed Jun 7 09:34:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feiyang Chen X-Patchwork-Id: 13270306 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF1218F47 for ; Wed, 7 Jun 2023 09:35:19 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1F18E1BCB for ; Wed, 7 Jun 2023 02:34:53 -0700 (PDT) Received: from loongson.cn (unknown [223.106.25.146]) by gateway (Coremail) with SMTP id _____8Cxe+o8T4BkRhgAAA--.349S3; Wed, 07 Jun 2023 17:34:52 +0800 (CST) Received: from localhost.localdomain (unknown [223.106.25.146]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxXMo7T4BkGzwEAA--.6785S2; Wed, 07 Jun 2023 17:34:52 +0800 (CST) From: Feiyang Chen To: peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, maxime.chevallier@bootlin.com Cc: Feiyang Chen , netdev@vger.kernel.org, loongson-kernel@lists.loongnix.cn, chris.chenfeiyang@gmail.com, Yanteng Si Subject: [PATCH] net: stmmac: Fix stmmac_mdio_unregister() build errors Date: Wed, 7 Jun 2023 17:34:40 +0800 Message-Id: <20230607093440.4131484-1-chenfeiyang@loongson.cn> X-Mailer: git-send-email 2.39.3 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: AQAAf8CxXMo7T4BkGzwEAA--.6785S2 X-CM-SenderInfo: hfkh0wphl1t03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoWrKr45uFyUJ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6r4UYxBIdaVFxhVj vjDU0xZFpf9x07j8a9-UUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org 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 Fixes: 5d1f3fe7d2d5 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver") Signed-off-by: Feiyang Chen --- 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;