Commit 32a64161 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: phy: Utilize phy_interface_is_rgmii

Update all open-coded tests for all 4 PHY_INTERFACE_MODE_RGMII* values
to use the newly introduced helper: phy_interface_is_rgmii.
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e463d88c
...@@ -139,10 +139,7 @@ static int ip1001_config_init(struct phy_device *phydev) ...@@ -139,10 +139,7 @@ static int ip1001_config_init(struct phy_device *phydev)
if (c < 0) if (c < 0)
return c; return c;
if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) || if (phy_interface_is_rgmii(phydev)) {
(phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
(phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
(phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
if (c < 0) if (c < 0)
......
...@@ -317,10 +317,7 @@ static int m88e1121_config_aneg(struct phy_device *phydev) ...@@ -317,10 +317,7 @@ static int m88e1121_config_aneg(struct phy_device *phydev)
if (err < 0) if (err < 0)
return err; return err;
if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) || if (phy_interface_is_rgmii(phydev)) {
(phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
(phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
(phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
mscr = phy_read(phydev, MII_88E1121_PHY_MSCR_REG) & mscr = phy_read(phydev, MII_88E1121_PHY_MSCR_REG) &
MII_88E1121_PHY_MSCR_DELAY_MASK; MII_88E1121_PHY_MSCR_DELAY_MASK;
...@@ -469,10 +466,7 @@ static int m88e1111_config_init(struct phy_device *phydev) ...@@ -469,10 +466,7 @@ static int m88e1111_config_init(struct phy_device *phydev)
int err; int err;
int temp; int temp;
if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) || if (phy_interface_is_rgmii(phydev)) {
(phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
(phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
(phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
temp = phy_read(phydev, MII_M1111_PHY_EXT_CR); temp = phy_read(phydev, MII_M1111_PHY_EXT_CR);
if (temp < 0) if (temp < 0)
......
...@@ -1093,8 +1093,7 @@ int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable) ...@@ -1093,8 +1093,7 @@ int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable)
if ((phydev->duplex == DUPLEX_FULL) && if ((phydev->duplex == DUPLEX_FULL) &&
((phydev->interface == PHY_INTERFACE_MODE_MII) || ((phydev->interface == PHY_INTERFACE_MODE_MII) ||
(phydev->interface == PHY_INTERFACE_MODE_GMII) || (phydev->interface == PHY_INTERFACE_MODE_GMII) ||
(phydev->interface >= PHY_INTERFACE_MODE_RGMII && phy_interface_is_rgmii(phydev) ||
phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID) ||
phy_is_internal(phydev))) { phy_is_internal(phydev))) {
int eee_lp, eee_cap, eee_adv; int eee_lp, eee_cap, eee_adv;
u32 lp, cap, adv; u32 lp, cap, adv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment