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 7728A30FC2C for ; Fri, 7 Nov 2025 08:29:33 +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=1762504176; cv=none; b=ABuT+BXwJ3NTLhr6EBTYAoDyW9QX4AWUCI05rtnDAuNw+KHNUJ8/XsTG0Y6fVYmBCTxcIKW55HZemutS5VAe5uXF7AHZ0ji9lWj5f7P2keQpl4lFp7t9Zdu4T9k/p3uYR7sdl0Gnv5BX/J6hA8TXuSIkTiBM5wmTJ9Zu4mOEC/Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762504176; c=relaxed/simple; bh=A6Aq3pXklade7nTmcymJ2OsMgOZXXWnhbZ5kena6m6g=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=hErY5/Oi1ovxst3OxpEHdqMI34CE6wHePjI6qBaLV8wYdDD5kIdFwY5S6+yyzZ/9e1qaMegZo/j0mp7HbHVVI1fI4EazwTY6izz76OlndhWn5I/sgzXa/g2YY5p5Lhf4ylJ05a7Hz4VIq9wgjAGj4A+qmhGONNJyeJoeL/TJmUI= 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=znNfCcyV; 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="znNfCcyV" 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=WD62xUP/T2Mw7V+znRa1dwNt/ZSLS3fdpXY/nmG7E2I=; b=znNfCcyVEG3EoEy5cOqpR9t9zr z5lOh1KluztqqLZQ4NUnKcJzTrJhBFIJ20clkLTe5b5GivO98D49sp2W9YkHrt6ktOKtDmvE8LnNN 3Do23P0idblmgBtxbOSfZ8nXIiMgZP7Styh7RyLIo8GVykF68CnwLPI5VcMdmgtGzL6A3PeXOb2xP 7ERH+byg1hfP/rxVtPdG2Pw8Nn90HQRNScwpD9NAyXEbYCCFu889LoatVuns7dGEupYzIkz5SG7DM Oa7pRm+PMDDq6htak4SvBGts7Q2f23UCH72oQEd/hjWpG5KCxcmgwfh+QlbCYuqMs7XonY025CB5D JyTbvyEw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:33942 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 1vHHqU-000000006BL-20Ng; Fri, 07 Nov 2025 08:29:23 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vHHqT-0000000Djrh-0ka3; Fri, 07 Nov 2025 08:29:21 +0000 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 v3 10/11] net: stmmac: ingenic: pass ingenic_mac struct rather than plat_dat Precedence: bulk X-Mailing-List: netdev@vger.kernel.org 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: Fri, 07 Nov 2025 08:29:21 +0000 It no longer makes sense to pass a pointer to struct plat_stmmacenet_data when calling the set_mode() methods to only use it to get a pointer to the ingenic_mac structure that we already had in the caller. Simplify this by passing the struct ingenic_mac pointer. Reviewed-by: Maxime Chevallier Signed-off-by: Russell King (Oracle) --- .../ethernet/stmicro/stmmac/dwmac-ingenic.c | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c index eb5744e0b9ea..41a2071262bc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c @@ -64,15 +64,13 @@ struct ingenic_soc_info { enum ingenic_mac_version version; u32 mask; - int (*set_mode)(struct plat_stmmacenet_data *plat_dat, u8 phy_intf_sel); + int (*set_mode)(struct ingenic_mac *mac, u8 phy_intf_sel); u8 valid_phy_intf_sel; }; -static int jz4775_mac_set_mode(struct plat_stmmacenet_data *plat_dat, - u8 phy_intf_sel) +static int jz4775_mac_set_mode(struct ingenic_mac *mac, u8 phy_intf_sel) { - struct ingenic_mac *mac = plat_dat->bsp_priv; unsigned int val; val = FIELD_PREP(MACPHYC_PHY_INFT_MASK, phy_intf_sel) | @@ -82,19 +80,14 @@ static int jz4775_mac_set_mode(struct plat_stmmacenet_data *plat_dat, return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val); } -static int x1000_mac_set_mode(struct plat_stmmacenet_data *plat_dat, - u8 phy_intf_sel) +static int x1000_mac_set_mode(struct ingenic_mac *mac, u8 phy_intf_sel) { - struct ingenic_mac *mac = plat_dat->bsp_priv; - /* Update MAC PHY control register */ return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, 0); } -static int x1600_mac_set_mode(struct plat_stmmacenet_data *plat_dat, - u8 phy_intf_sel) +static int x1600_mac_set_mode(struct ingenic_mac *mac, u8 phy_intf_sel) { - struct ingenic_mac *mac = plat_dat->bsp_priv; unsigned int val; val = FIELD_PREP(MACPHYC_PHY_INFT_MASK, phy_intf_sel); @@ -103,10 +96,8 @@ static int x1600_mac_set_mode(struct plat_stmmacenet_data *plat_dat, return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val); } -static int x1830_mac_set_mode(struct plat_stmmacenet_data *plat_dat, - u8 phy_intf_sel) +static int x1830_mac_set_mode(struct ingenic_mac *mac, u8 phy_intf_sel) { - struct ingenic_mac *mac = plat_dat->bsp_priv; unsigned int val; val = FIELD_PREP(MACPHYC_MODE_SEL_MASK, MACPHYC_MODE_SEL_RMII) | @@ -116,10 +107,8 @@ static int x1830_mac_set_mode(struct plat_stmmacenet_data *plat_dat, return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val); } -static int x2000_mac_set_mode(struct plat_stmmacenet_data *plat_dat, - u8 phy_intf_sel) +static int x2000_mac_set_mode(struct ingenic_mac *mac, u8 phy_intf_sel) { - struct ingenic_mac *mac = plat_dat->bsp_priv; unsigned int val; val = FIELD_PREP(MACPHYC_PHY_INFT_MASK, phy_intf_sel); @@ -165,7 +154,7 @@ static int ingenic_mac_init(struct platform_device *pdev, void *bsp_priv) dev_dbg(mac->dev, "MAC PHY control register: interface %s\n", phy_modes(interface)); - ret = mac->soc_info->set_mode(mac->plat_dat, phy_intf_sel); + ret = mac->soc_info->set_mode(mac, phy_intf_sel); if (ret) return ret; } -- 2.47.3