]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: qcom-ethqos: pass ethqos to ethqos_pcs_set_inband()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 27 Mar 2026 08:43:33 +0000 (08:43 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 31 Mar 2026 00:36:44 +0000 (17:36 -0700)
Rather than getting the stmmac_priv pointer in
ethqos_configure_sgmii(), move it into ethqos_pcs_set_inband() and pass
the struct qcom_ethqos pointer instead.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Link: https://patch.msgid.link/E1w62mz-0000000E3Bx-1Xd8@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c

index 502f2b184a8722daa1ddcd93f90acf319771ea8e..b9cfcf32cebc4d817b07517a4bb6c33c71068e1a 100644 (file)
@@ -590,8 +590,11 @@ static void ethqos_configure_rgmii(struct qcom_ethqos *ethqos,
        ethqos_rgmii_macro_init(ethqos, speed);
 }
 
-static void ethqos_pcs_set_inband(struct stmmac_priv *priv, bool enable)
+static void ethqos_pcs_set_inband(struct qcom_ethqos *ethqos, bool enable)
 {
+       struct net_device *dev = platform_get_drvdata(ethqos->pdev);
+       struct stmmac_priv *priv = netdev_priv(dev);
+
        stmmac_pcs_ctrl_ane(priv, enable, 0);
 }
 
@@ -601,9 +604,6 @@ static void ethqos_pcs_set_inband(struct stmmac_priv *priv, bool enable)
 static void ethqos_configure_sgmii(struct qcom_ethqos *ethqos,
                                   phy_interface_t interface, int speed)
 {
-       struct net_device *dev = platform_get_drvdata(ethqos->pdev);
-       struct stmmac_priv *priv = netdev_priv(dev);
-
        switch (speed) {
        case SPEED_2500:
        case SPEED_1000:
@@ -620,7 +620,7 @@ static void ethqos_configure_sgmii(struct qcom_ethqos *ethqos,
                break;
        }
 
-       ethqos_pcs_set_inband(priv, interface == PHY_INTERFACE_MODE_SGMII);
+       ethqos_pcs_set_inband(ethqos, interface == PHY_INTERFACE_MODE_SGMII);
 }
 
 static void ethqos_fix_mac_speed(void *priv, phy_interface_t interface,