]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: replace ioaddr with stmmac_priv for pcs_set_ane() method
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 18 Jun 2025 11:05:12 +0000 (12:05 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 19 Jun 2025 22:11:25 +0000 (15:11 -0700)
Pass the stmmac_priv structure into the pcs_set_ane() MAC method rather
than having callers dereferencing this structure for the IO address.

Tested-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> # sa8775p-ride-r3
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/E1uRqbQ-004djP-1l@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
drivers/net/ethernet/stmicro/stmmac/hwif.h
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 2e398574c7a70a54a16a5d09a73d8eeb968bee9e..d8fd4d8f6ced76cbe198f3d3443084daee151b04 100644 (file)
@@ -624,7 +624,7 @@ static void ethqos_set_serdes_speed(struct qcom_ethqos *ethqos, int speed)
 
 static void ethqos_pcs_set_inband(struct stmmac_priv *priv, bool enable)
 {
-       stmmac_pcs_ctrl_ane(priv, priv->ioaddr, enable, 0, 0);
+       stmmac_pcs_ctrl_ane(priv, enable, 0, 0);
 }
 
 /* On interface toggle MAC registers gets reset.
index 38875c832bb8ebb67e0abff96b4b02d042792bae..fe776ddf68895266ee67a852a13382089f664003 100644 (file)
@@ -393,10 +393,10 @@ static void dwmac1000_set_eee_timer(struct mac_device_info *hw, int ls, int tw)
        writel(value, ioaddr + LPI_TIMER_CTRL);
 }
 
-static void dwmac1000_ctrl_ane(void __iomem *ioaddr, bool ane, bool srgmi_ral,
-                              bool loopback)
+static void dwmac1000_ctrl_ane(struct stmmac_priv *priv, bool ane,
+                              bool srgmi_ral, bool loopback)
 {
-       dwmac_ctrl_ane(ioaddr, GMAC_PCS_BASE, ane, srgmi_ral, loopback);
+       dwmac_ctrl_ane(priv->ioaddr, GMAC_PCS_BASE, ane, srgmi_ral, loopback);
 }
 
 static void dwmac1000_debug(struct stmmac_priv *priv, void __iomem *ioaddr,
index bc06b24fc61168485157075bf443b4e4454e3b5e..d85bc0bb5c3c05e72a67e440c44eb5c33180cf5c 100644 (file)
@@ -583,10 +583,10 @@ static void dwmac4_flow_ctrl(struct mac_device_info *hw, unsigned int duplex,
        }
 }
 
-static void dwmac4_ctrl_ane(void __iomem *ioaddr, bool ane, bool srgmi_ral,
+static void dwmac4_ctrl_ane(struct stmmac_priv *priv, bool ane, bool srgmi_ral,
                            bool loopback)
 {
-       dwmac_ctrl_ane(ioaddr, GMAC_PCS_BASE, ane, srgmi_ral, loopback);
+       dwmac_ctrl_ane(priv->ioaddr, GMAC_PCS_BASE, ane, srgmi_ral, loopback);
 }
 
 /* RGMII or SMII interface */
index e1ac9a245bfe9c943605f1aae505a6667a6faf1a..14dbe0685997db5f0432445c1bb3c45ace16ce26 100644 (file)
@@ -374,7 +374,7 @@ struct stmmac_ops {
                      struct stmmac_extra_stats *x, u32 rx_queues,
                      u32 tx_queues);
        /* PCS calls */
-       void (*pcs_ctrl_ane)(void __iomem *ioaddr, bool ane, bool srgmi_ral,
+       void (*pcs_ctrl_ane)(struct stmmac_priv *priv, bool ane, bool srgmi_ral,
                             bool loopback);
        /* Safety Features */
        int (*safety_feat_config)(void __iomem *ioaddr, unsigned int asp,
@@ -464,7 +464,7 @@ struct stmmac_ops {
 #define stmmac_mac_debug(__priv, __args...) \
        stmmac_do_void_callback(__priv, mac, debug, __priv, __args)
 #define stmmac_pcs_ctrl_ane(__priv, __args...) \
-       stmmac_do_void_callback(__priv, mac, pcs_ctrl_ane, __args)
+       stmmac_do_void_callback(__priv, mac, pcs_ctrl_ane, __priv, __args)
 #define stmmac_safety_feat_config(__priv, __args...) \
        stmmac_do_callback(__priv, mac, safety_feat_config, __args)
 #define stmmac_safety_feat_irq_status(__priv, __args...) \
index 72f1724af037ecea6050f3db5fb17c8e5977faaf..77758a7299b4ebbe5be754490a00b6187dcdb8fc 100644 (file)
@@ -380,7 +380,7 @@ stmmac_ethtool_set_link_ksettings(struct net_device *dev,
                        return -EINVAL;
 
                mutex_lock(&priv->lock);
-               stmmac_pcs_ctrl_ane(priv, priv->ioaddr, 1, priv->hw->ps, 0);
+               stmmac_pcs_ctrl_ane(priv, 1, priv->hw->ps, 0);
                mutex_unlock(&priv->lock);
 
                return 0;
index c3845ec62fbdb65d0b4ef3b87cd611272d9db833..f350a6662880a230a32ad6785c475cce4e950322 100644 (file)
@@ -3586,7 +3586,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
        }
 
        if (priv->hw->pcs)
-               stmmac_pcs_ctrl_ane(priv, priv->ioaddr, 1, priv->hw->ps, 0);
+               stmmac_pcs_ctrl_ane(priv, 1, priv->hw->ps, 0);
 
        /* set TX and RX rings length */
        stmmac_set_rings_length(priv);