]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: dwmac-socfpga: Move internal helpers
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Tue, 24 Mar 2026 09:20:56 +0000 (10:20 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 27 Mar 2026 01:19:41 +0000 (18:19 -0700)
This is preparatory work to allow reusing the SGMII configuration helper
and the wrapper to get the interface in the fix_mac_speed() callback.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20260324092102.687082-2-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c

index 5f89fd968ae94e27b33d0d089ba51d37456c64d5..42da73b92cebb03989114229f78befab0ca1c8b0 100644 (file)
@@ -72,6 +72,18 @@ struct socfpga_dwmac {
        const struct socfpga_dwmac_ops *ops;
 };
 
+static int socfpga_get_plat_phymode(struct socfpga_dwmac *dwmac)
+{
+       return dwmac->plat_dat->phy_interface;
+}
+
+static void socfpga_sgmii_config(struct socfpga_dwmac *dwmac, bool enable)
+{
+       u16 val = enable ? SGMII_ADAPTER_ENABLE : SGMII_ADAPTER_DISABLE;
+
+       writew(val, dwmac->sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG);
+}
+
 static void socfpga_dwmac_fix_mac_speed(void *bsp_priv,
                                        phy_interface_t interface, int speed,
                                        unsigned int mode)
@@ -244,18 +256,6 @@ err_node_put:
        return ret;
 }
 
-static int socfpga_get_plat_phymode(struct socfpga_dwmac *dwmac)
-{
-       return dwmac->plat_dat->phy_interface;
-}
-
-static void socfpga_sgmii_config(struct socfpga_dwmac *dwmac, bool enable)
-{
-       u16 val = enable ? SGMII_ADAPTER_ENABLE : SGMII_ADAPTER_DISABLE;
-
-       writew(val, dwmac->sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG);
-}
-
 static int socfpga_set_phy_mode_common(int phymode, u32 *val)
 {
        switch (phymode) {