From: Maxime Chevallier Date: Tue, 24 Mar 2026 09:20:57 +0000 (+0100) Subject: net: stmmac: dwmac-socfpga: Use the socfpga_sgmii_config() helper X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7be7cc12442479f44e3c17c6070cff03f6f8f02;p=thirdparty%2Fkernel%2Flinux.git net: stmmac: dwmac-socfpga: Use the socfpga_sgmii_config() helper Use the existing socfpga_sgmii_config() helper in socfpga_dwmac_fix_mac_speed(), instead of re-coding the register access. Signed-off-by: Maxime Chevallier Reviewed-by: Russell King (Oracle) Link: https://patch.msgid.link/20260324092102.687082-3-maxime.chevallier@bootlin.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index 42da73b92ceb..ed6448c0ad2a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c @@ -95,8 +95,7 @@ static void socfpga_dwmac_fix_mac_speed(void *bsp_priv, u32 val; if (sgmii_adapter_base) - writew(SGMII_ADAPTER_DISABLE, - sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); + socfpga_sgmii_config(dwmac, false); if (splitter_base) { val = readl(splitter_base + EMAC_SPLITTER_CTRL_REG); @@ -121,8 +120,7 @@ static void socfpga_dwmac_fix_mac_speed(void *bsp_priv, if ((priv->plat->phy_interface == PHY_INTERFACE_MODE_SGMII || priv->plat->phy_interface == PHY_INTERFACE_MODE_1000BASEX) && sgmii_adapter_base) - writew(SGMII_ADAPTER_ENABLE, - sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); + socfpga_sgmii_config(dwmac, true); } static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *dev)