aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/realtek
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2020-01-09 20:28:08 +0100
committerDavid S. Miller <davem@davemloft.net>2020-01-10 16:41:34 -0800
commit4c867e36b89e820d6ddd901cc75b943a1e511be4 (patch)
treea8e18f659b91de7de27e29809da07fe0f697cb04 /drivers/net/ethernet/realtek
parentr8169: change argument type of EEE PHY functions (diff)
downloadlinux-dev-4c867e36b89e820d6ddd901cc75b943a1e511be4.tar.xz
linux-dev-4c867e36b89e820d6ddd901cc75b943a1e511be4.zip
r8169: change argument type of RTL8168g-specific PHY config functions
These functions use only the phy_device member of rtl8169_private, so we can pass the phy_device as parameter directly. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/realtek')
-rw-r--r--drivers/net/ethernet/realtek/r8169_main.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index dcb6fedf8380..94bad2b09293 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -3058,15 +3058,13 @@ static void rtl8411_hw_phy_config(struct rtl8169_private *tp,
rtl_writephy(tp, 0x1f, 0x0000);
}
-static void rtl8168g_disable_aldps(struct rtl8169_private *tp)
+static void rtl8168g_disable_aldps(struct phy_device *phydev)
{
- phy_modify_paged(tp->phydev, 0x0a43, 0x10, BIT(2), 0);
+ phy_modify_paged(phydev, 0x0a43, 0x10, BIT(2), 0);
}
-static void rtl8168g_phy_adjust_10m_aldps(struct rtl8169_private *tp)
+static void rtl8168g_phy_adjust_10m_aldps(struct phy_device *phydev)
{
- struct phy_device *phydev = tp->phydev;
-
phy_modify_paged(phydev, 0x0bcc, 0x14, BIT(8), 0);
phy_modify_paged(phydev, 0x0a44, 0x11, 0, BIT(7) | BIT(6));
r8168g_phy_param(phydev, 0x8084, 0x6000, 0x0000);
@@ -3095,7 +3093,7 @@ static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp,
/* Enable PHY auto speed down */
phy_modify_paged(phydev, 0x0a44, 0x11, 0, BIT(3) | BIT(2));
- rtl8168g_phy_adjust_10m_aldps(tp);
+ rtl8168g_phy_adjust_10m_aldps(phydev);
/* EEE auto-fallback function */
phy_modify_paged(phydev, 0x0a4b, 0x11, 0, BIT(2));
@@ -3117,7 +3115,7 @@ static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp,
rtl_writephy(tp, 0x14, 0x1065);
rtl_writephy(tp, 0x1f, 0x0000);
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168g_config_eee_phy(phydev);
}
@@ -3190,7 +3188,7 @@ static void rtl8168h_1_hw_phy_config(struct rtl8169_private *tp,
/* disable phy pfm mode */
phy_modify_paged(phydev, 0x0a44, 0x11, BIT(7), 0);
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168h_config_eee_phy(phydev);
}
@@ -3244,7 +3242,7 @@ static void rtl8168h_2_hw_phy_config(struct rtl8169_private *tp,
/* disable phy pfm mode */
phy_modify_paged(phydev, 0x0a44, 0x11, BIT(7), 0);
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168g_config_eee_phy(phydev);
}
@@ -3254,7 +3252,7 @@ static void rtl8168ep_1_hw_phy_config(struct rtl8169_private *tp,
/* Enable PHY auto speed down */
phy_modify_paged(phydev, 0x0a44, 0x11, 0, BIT(3) | BIT(2));
- rtl8168g_phy_adjust_10m_aldps(tp);
+ rtl8168g_phy_adjust_10m_aldps(phydev);
/* Enable EEE auto-fallback function */
phy_modify_paged(phydev, 0x0a4b, 0x11, 0, BIT(2));
@@ -3265,14 +3263,14 @@ static void rtl8168ep_1_hw_phy_config(struct rtl8169_private *tp,
/* set rg_sel_sdm_rate */
phy_modify_paged(phydev, 0x0c42, 0x11, BIT(13), BIT(14));
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168g_config_eee_phy(phydev);
}
static void rtl8168ep_2_hw_phy_config(struct rtl8169_private *tp,
struct phy_device *phydev)
{
- rtl8168g_phy_adjust_10m_aldps(tp);
+ rtl8168g_phy_adjust_10m_aldps(phydev);
/* Enable UC LPF tune function */
r8168g_phy_param(phydev, 0x8012, 0x0000, 0x8000);
@@ -3315,7 +3313,7 @@ static void rtl8168ep_2_hw_phy_config(struct rtl8169_private *tp,
rtl_writephy(tp, 0x14, 0x1065);
rtl_writephy(tp, 0x1f, 0x0000);
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168g_config_eee_phy(phydev);
}
@@ -3353,7 +3351,7 @@ static void rtl8117_hw_phy_config(struct rtl8169_private *tp,
r8168g_phy_param(phydev, 0x8016, 0x0000, 0x0400);
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168h_config_eee_phy(phydev);
}