]> git.sur5r.net Git - u-boot/commitdiff
net: phy: vitesse: Fix cis8204 RGMII_ID code
authorPhil Edworthy <PHIL.EDWORTHY@renesas.com>
Mon, 12 Dec 2016 15:27:12 +0000 (15:27 +0000)
committerJoe Hershberger <joe.hershberger@ni.com>
Tue, 7 Feb 2017 16:54:34 +0000 (10:54 -0600)
Commit 79e86ccb3786c8b20004db3fa10a70049456f580 "vitesse: remove duplicated
argument to ||" correctly removed a redundant check.

However, I believe that the original code was simply wrong, and should have
been checking against RGMII_ID.

To fix this and avoid similar problems in the future, use the
phy_interface_is_rgmii helper function.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/phy/vitesse.c

index a077b98d8c451e5279fdc378feafa15d7b263f01..e5e9922b30f37eb8f1f54e487a5ba4c639ad495d 100644 (file)
@@ -127,9 +127,7 @@ static int cis8204_config(struct phy_device *phydev)
 
        genphy_config_aneg(phydev);
 
-       if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
-                       (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) ||
-                       (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID))
+       if (phy_interface_is_rgmii(phydev))
                phy_write(phydev, MDIO_DEVAD_NONE, MIIM_CIS8204_EPHY_CON,
                                MIIM_CIS8204_EPHYCON_INIT |
                                MIIM_CIS8204_EPHYCON_RGMII);