From patchwork Tue Apr 15 16:29:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 14052451 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A16A5C369AB for ; Tue, 15 Apr 2025 16:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:Content-Type :Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9n7bu2qX7LooirHoLY1Va5iaADryPdv8WBdIxT2RDo8=; b=3einzYsp9Oc+VaHDfhnKmG5a+j nNV4YRBHaZJxEs+yZ9t9A/NRULGE6cikD3AuVJnVWdbNAVHG9BbA3dNxWY/onktK0YB/y1mL87518 YoxkYXHXmvQ2PY0H++mjTF8TUrqnvTz6fmv4ssIYxGDEOOtH6ap4iYVpEn7G95DyHaz8zK7AgCKh+ r7enI9OBlHUTQjJG3e9eZxsbO68Nvl6nlBji7AKfbQxlkB6BHHvjPuASMrPVZttzNYK2r1lrMWmCe kFTxkW3U0ySc0QW5SVsSbqaZgJSAPbmMUpgJkTeu5k0JLmSitDkxmzUErRYadEmH8x3hom3HwjPSE hsnJDZNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4jVn-00000006TB0-34D3; Tue, 15 Apr 2025 16:51:51 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4jAY-00000006Pwg-0aXQ for linux-arm-kernel@lists.infradead.org; Tue, 15 Apr 2025 16:29:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=9n7bu2qX7LooirHoLY1Va5iaADryPdv8WBdIxT2RDo8=; b=p705deL34FQCm0Dclxwms3LDyK YS2H1rGQQW5Tf1PNWCX2n5xv1Aatv06GcMnWcMdBmXHkn/rfCsn06vkbVcAjPHPzEwbIEHNo1syiw RP3J6xDW/5rFlF2Y/tEfRB/fIn9/RmcA3kZvZWwDaJIwXAaWbc2zZj/LnaPj37zc8itbmBuREAwiD FzvVk2h9yjuNlPvzILySyNXiiWjlm25Zyu4NjEp5GC1dMVudNqF5dXprT3UXR8UDyVeAlQ2fSZqsd Nl7ym3YzNj+LEZ5ZzUajhDBHlLrqYmpKUeAEnnAmR49YBrz6j4Hxt5EK/3dpBHOIip9NLyO23JYB4 mL2HuuyA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:47222 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u4jAT-0008TY-0T; Tue, 15 Apr 2025 17:29:49 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1u4j9r-000r1P-Ra; Tue, 15 Apr 2025 17:29:11 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 2/5] net: stmmac: socfpga: provide init function MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 15 Apr 2025 17:29:11 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250415_092954_179621_7D497F91 X-CRM114-Status: GOOD ( 11.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Both the resume and probe path needs to configure the phy mode, so provide a common function to do this which can later be hooked into plat_dat->init. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index bcdb25ee2a33..000d349a6d4c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c @@ -435,6 +435,13 @@ static struct phylink_pcs *socfpga_dwmac_select_pcs(struct stmmac_priv *priv, return priv->hw->phylink_pcs; } +static int socfpga_dwmac_init(struct platform_device *pdev, void *bsp_priv) +{ + struct socfpga_dwmac *dwmac = bsp_priv; + + return dwmac->ops->set_phy_mode(dwmac); +} + static int socfpga_dwmac_probe(struct platform_device *pdev) { struct plat_stmmacenet_data *plat_dat; @@ -497,7 +504,7 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) if (ret) return ret; - ret = ops->set_phy_mode(dwmac); + ret = socfpga_dwmac_init(pdev, dwmac); if (ret) goto err_dvr_remove; @@ -516,7 +523,7 @@ static int socfpga_dwmac_resume(struct device *dev) struct stmmac_priv *priv = netdev_priv(ndev); struct socfpga_dwmac *dwmac_priv = get_stmmac_bsp_priv(dev); - dwmac_priv->ops->set_phy_mode(priv->plat->bsp_priv); + socfpga_dwmac_init(to_platform_device(dev), dwmac_priv); return stmmac_resume(dev); }