Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6837017rwd; Tue, 6 Jun 2023 02:39:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5khlS59rJf61Owx4R/YaSbX3ozG7bpFh/sBN5oK0uzdmBJqhjOcE87Ke8es690oaJ/NXZC X-Received: by 2002:a05:620a:1707:b0:75d:872c:6d4 with SMTP id az7-20020a05620a170700b0075d872c06d4mr1495994qkb.37.1686044381459; Tue, 06 Jun 2023 02:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686044381; cv=none; d=google.com; s=arc-20160816; b=Jh6yKObFgjKur71l9xl4epNfINpaY3B6pmOgVofqifkDZdmeY1nDNR0erSuHvs4gWT SpIS6rBaYamnYqHQOdW8xEWRzirU7stgfdue+KwIM86nii5UU+K8mr33p/jjpMbhSSlb 0vAcEC/6L5ijrw1yRxRLF87qQMErAPsAo7kr8kSunxJnRcc8X6KvPjSDmJ2LHd0O35di sbZLkaLfiKn4oZf59Pakcxsk767jUGuekOtLLhzVqRuf6ijmQiaWnr3t9D5dSbYuOr92 cykpPrsJjNlh1/oCsCFlmMqr+l3B25MWmk/4lduypfe/U0zO52TG1YZB9Z0oLZfL0Nri hLgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=3v6mSvu04Pw3GcdnZm0etGwwQs6Dtxrjx1g0OcfV+2s=; b=0NzibzeV6oifWQD3lTlrTFPeW7DHDk7dk8rVXaVTVPDFY3on5fW6WuWI5gnIyEaVG5 ypywsJBGO/AQHApB7m+E6Pwigb8kSwLfPcIgLDwjrQCnqJKEegD89pPi+gg+I+cAFpgp cjsno7L/DYsyfUqxDicg3rhDcjLNPJow/usj5+CYBRQh43b0BYZA4eo9grh3olQp4sZ2 uX2hkiMNawBoUJI9yaTkWClH8HY3lEY0qTbsDJ9mwAQWl/eSZyp7Q9OgUvWgvYNahcfe GYKj707YJOB3jtn9cTv54Fw7A+h+KQmM4x5l8LgBkuEItbStZ97U1ugreCjiAqJnEW2C +B+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a05620a126c00b0075cc54d5943si5611659qkl.358.2023.06.06.02.39.27; Tue, 06 Jun 2023 02:39:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232329AbjFFI3C (ORCPT + 99 others); Tue, 6 Jun 2023 04:29:02 -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: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If STMMAC_ETH=y, but PCS_LYNX=n (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 driver") 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/net/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); - if (priv->hw->lynx_pcs) + if (IS_ENABLED(CONFIG_PCS_LYNX) && priv->hw->lynx_pcs) lynx_pcs_destroy(priv->hw->lynx_pcs); mdiobus_unregister(priv->mii); -- 2.34.1