net/phy: Fix copper/fiber auto-selection for 88e1111
[firefly-linux-kernel-4.4.55.git] / drivers / net / phy / marvell.c
index 33539917e9b8008d6890e872e9d4ab7550b06d6d..737512c00971dbe722252405c95a9eec51d2576b 100644 (file)
@@ -162,7 +162,7 @@ static int m88e1111_config_init(struct phy_device *phydev)
 
        /* Enable Fiber/Copper auto selection */
        temp = phy_read(phydev, MII_M1111_PHY_EXT_SR);
-       temp |= MII_M1111_HWCFG_FIBER_COPPER_AUTO;
+       temp &= ~MII_M1111_HWCFG_FIBER_COPPER_AUTO;
        phy_write(phydev, MII_M1111_PHY_EXT_SR, temp);
 
        temp = phy_read(phydev, MII_BMCR);
@@ -211,8 +211,6 @@ static int m88e1111_config_init(struct phy_device *phydev)
        }
 
        if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
-               int temp;
-
                temp = phy_read(phydev, MII_M1111_PHY_EXT_SR);
                if (temp < 0)
                        return temp;