From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 DDE2A304969 for ; Mon, 3 Nov 2025 11:51:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762170664; cv=none; b=P3M0f//aOvxVk6rA9PmNhOkSczpnEfUTMQuT9ie0OjcyMLxQVwaNACqlw2wh2RFWhYudQkYudUgrwgJJFH8y/XIXWGg7imuG5prRLpe+Y/hz5Gy1b8VuDA29rkSY9rALSpg/Gl507Q0aRDWN1yT5JkrG/3zBu0t4rdBv4mHP9Qk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762170664; c=relaxed/simple; bh=OaweDFw6r8wo8t3Ta0J4ld6p77BeQtTkVqn6cujitro=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=l9ukhgLMw+ed2hLpo1Ykjp6A7IOFOfTj4nlBqLWCrejmcW51ZT4K8dO1xRwlrknMOxk0mt3qjwBe05/w3BBL8+ctRfAUOqapZT8TTJfMRQc7ybbSg9Y1/lGnCylqe99TTY/rfkUhziuEB2+9iQ0ybfSwawuPJYpGxn9Sm6fs650= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=qhfkoLKS; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="qhfkoLKS" 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=okBTt2dNUP6FihBBbCP6ZKAhHbkxHeLb6qWCrp67ut0=; b=qhfkoLKSZwTgec07OjcdenMOVo 34zjbYTik7uh+2+KeeCRyxZCS1hYSDX2s7FqQbGZbnFrzk6viwP0gIgI1Stkw7YXb+H00n0R1tVSZ +4VluEEOp4rBu1kiA1ydsH8dS8FcnA+J4x5XaUzxEDa842+t9W5GF3E52yWEEqVacxPYFH19KOErL XUo2ks+sFKvXv7guXiSDkgp7JBIsdKvsupEKVZCqOuxQZiO8PYiGGaEjfPXTy77k6S0D/P0AMxZOi Ye0gIvHHrr1+jOmWeMizEtWVIe5pQ9vxMQtsxfkT+bOj5fyr1lk1p5WY+a+pIGep2e/V+tBHYqGm/ PtLg4acg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:35368 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.98.2) (envelope-from ) id 1vFt5D-000000000i5-3Ftu; Mon, 03 Nov 2025 11:50:48 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vFt57-0000000ChpL-25kS; Mon, 03 Nov 2025 11:50:41 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Fabio Estevam , imx@lists.linux.dev, Jakub Kicinski , Jan Petrous , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni , Pengutronix Kernel Team , s32@nxp.com, Sascha Hauer , Shawn Guo Subject: [PATCH net-next 10/11] net: stmmac: imx: cleanup arguments for set_intf_mode() method Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Mon, 03 Nov 2025 11:50:41 +0000 Pass the imx_priv_data instead of the plat_stmmacenet_data into the set_intf_mode() SoC specific methods. Signed-off-by: Russell King (Oracle) --- .../net/ethernet/stmicro/stmmac/dwmac-imx.c | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c index d69be9de4468..ae1b73e1bcb2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c @@ -39,14 +39,15 @@ #define RMII_RESET_SPEED (0x3 << 14) #define CTRL_SPEED_MASK GENMASK(15, 14) +struct imx_priv_data; + struct imx_dwmac_ops { u32 addr_width; u32 flags; bool mac_rgmii_txclk_auto_adj; int (*fix_soc_reset)(struct stmmac_priv *priv, void __iomem *ioaddr); - int (*set_intf_mode)(struct plat_stmmacenet_data *plat_dat, - u8 phy_intf_sel); + int (*set_intf_mode)(struct imx_priv_data *dwmac, u8 phy_intf_sel); void (*fix_mac_speed)(void *priv, int speed, unsigned int mode); }; @@ -63,10 +64,8 @@ struct imx_priv_data { struct plat_stmmacenet_data *plat_dat; }; -static int imx8mp_set_intf_mode(struct plat_stmmacenet_data *plat_dat, - u8 phy_intf_sel) +static int imx8mp_set_intf_mode(struct imx_priv_data *dwmac, u8 phy_intf_sel) { - struct imx_priv_data *dwmac = plat_dat->bsp_priv; unsigned int val; val = FIELD_PREP(GPR_ENET_QOS_INTF_SEL_MASK, phy_intf_sel) | @@ -82,17 +81,14 @@ static int imx8mp_set_intf_mode(struct plat_stmmacenet_data *plat_dat, }; static int -imx8dxl_set_intf_mode(struct plat_stmmacenet_data *plat_dat, - u8 phy_intf_sel) +imx8dxl_set_intf_mode(struct imx_priv_data *dwmac, u8 phy_intf_sel) { /* TBD: depends on imx8dxl scu interfaces to be upstreamed */ return 0; } -static int imx93_set_intf_mode(struct plat_stmmacenet_data *plat_dat, - u8 phy_intf_sel) +static int imx93_set_intf_mode(struct imx_priv_data *dwmac, u8 phy_intf_sel) { - struct imx_priv_data *dwmac = plat_dat->bsp_priv; unsigned int val; int ret; @@ -140,14 +136,12 @@ static int imx_dwmac_clks_config(void *priv, bool enabled) static int imx_dwmac_init(struct platform_device *pdev, void *priv) { - struct plat_stmmacenet_data *plat_dat; struct imx_priv_data *dwmac = priv; phy_interface_t interface; int phy_intf_sel, ret; if (dwmac->ops->set_intf_mode) { - plat_dat = dwmac->plat_dat; - interface = plat_dat->phy_interface; + interface = dwmac->plat_dat->phy_interface; phy_intf_sel = stmmac_get_phy_intf_sel(interface); if (phy_intf_sel != PHY_INTF_SEL_GMII_MII && @@ -159,7 +153,7 @@ static int imx_dwmac_init(struct platform_device *pdev, void *priv) return phy_intf_sel < 0 ? phy_intf_sel : -EINVAL; } - ret = dwmac->ops->set_intf_mode(plat_dat, phy_intf_sel); + ret = dwmac->ops->set_intf_mode(dwmac, phy_intf_sel); if (ret) return ret; } -- 2.47.3