net: phy: Utilize phy_interface_is_rgmii
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 26 May 2015 19:19:59 +0000 (12:19 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2015 04:27:35 +0000 (00:27 -0400)
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: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/icplus.c
drivers/net/phy/marvell.c
drivers/net/phy/phy.c

index 8644f039d92274399fe9d3c1389474c07fe2df1c..0dbc445a5fa0f81b4dd1f3bc4bde663d7208116d 100644 (file)
@@ -139,10 +139,7 @@ static int ip1001_config_init(struct phy_device *phydev)
        if (c < 0)
                return c;
 
-       if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
-           (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
-           (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
-           (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
+       if (phy_interface_is_rgmii(phydev)) {
 
                c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
                if (c < 0)
index 1b1698f98818219c623038c8781dc2e806a3070d..f721444c2b0a9413dd0bac8c7e61099cf6d3789b 100644 (file)
@@ -317,10 +317,7 @@ static int m88e1121_config_aneg(struct phy_device *phydev)
        if (err < 0)
                return err;
 
-       if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
-           (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
-           (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
-           (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
+       if (phy_interface_is_rgmii(phydev)) {
 
                mscr = phy_read(phydev, MII_88E1121_PHY_MSCR_REG) &
                        MII_88E1121_PHY_MSCR_DELAY_MASK;
@@ -469,10 +466,7 @@ static int m88e1111_config_init(struct phy_device *phydev)
        int err;
        int temp;
 
-       if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
-           (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
-           (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
-           (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
+       if (phy_interface_is_rgmii(phydev)) {
 
                temp = phy_read(phydev, MII_M1111_PHY_EXT_CR);
                if (temp < 0)
index 377d2db04d33be594babb74a6b58479df480f82d..b2197b506acbe86f3540d5ae1d8334129c2bbe57 100644 (file)
@@ -1093,8 +1093,7 @@ int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable)
        if ((phydev->duplex == DUPLEX_FULL) &&
            ((phydev->interface == PHY_INTERFACE_MODE_MII) ||
            (phydev->interface == PHY_INTERFACE_MODE_GMII) ||
-           (phydev->interface >= PHY_INTERFACE_MODE_RGMII &&
-            phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID) ||
+            phy_interface_is_rgmii(phydev) ||
             phy_is_internal(phydev))) {
                int eee_lp, eee_cap, eee_adv;
                u32 lp, cap, adv;