]> git.sur5r.net Git - u-boot/commitdiff
net: phy: ti: Fix dp83867 RGMII_TXID interface path
authorPhil Edworthy <PHIL.EDWORTHY@renesas.com>
Fri, 9 Dec 2016 10:46:02 +0000 (10:46 +0000)
committerJoe Hershberger <joe.hershberger@ni.com>
Tue, 7 Feb 2017 16:54:33 +0000 (10:54 -0600)
There is code that is specifically for RGMII_TXID interface, but this
will never get used because the code checks that the RGMII interface
is RGMII_ID to RGMII_RXID; RGMII_TXID is after this.

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/ti.c

index c55dd973f4c3ea6d8d1e2cc2966e4f233d37d920..5e2b2dd9ddc6bcda580c29a07e61f6c5e53da088 100644 (file)
@@ -246,8 +246,7 @@ static int dp83867_config(struct phy_device *phydev)
                phy_write(phydev, MDIO_DEVAD_NONE, MII_DP83867_BISCR, 0x0);
        }
 
-       if ((phydev->interface >= PHY_INTERFACE_MODE_RGMII_ID) &&
-           (phydev->interface <= PHY_INTERFACE_MODE_RGMII_RXID)) {
+       if (phy_interface_is_rgmii(phydev)) {
                val = phy_read_mmd_indirect(phydev, DP83867_RGMIICTL,
                                            DP83867_DEVADDR, phydev->addr);