These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / net / ethernet / freescale / ucc_geth.c
index 4dd40e0..650f788 100644 (file)
@@ -1384,6 +1384,8 @@ static int adjust_enet_interface(struct ucc_geth_private *ugeth)
                value = phy_read(tbiphy, ENET_TBI_MII_CR);
                value &= ~0x1000;       /* Turn off autonegotiation */
                phy_write(tbiphy, ENET_TBI_MII_CR, value);
+
+               put_device(&tbiphy->dev);
        }
 
        init_check_frame_length_mode(ug_info->lengthCheckRx, &ug_regs->maccfg2);
@@ -1702,8 +1704,10 @@ static void uec_configure_serdes(struct net_device *dev)
         * everything for us?  Resetting it takes the link down and requires
         * several seconds for it to come back.
         */
-       if (phy_read(tbiphy, ENET_TBI_MII_SR) & TBISR_LSTATUS)
+       if (phy_read(tbiphy, ENET_TBI_MII_SR) & TBISR_LSTATUS) {
+               put_device(&tbiphy->dev);
                return;
+       }
 
        /* Single clk mode, mii mode off(for serdes communication) */
        phy_write(tbiphy, ENET_TBI_MII_ANA, TBIANA_SETTINGS);
@@ -1711,6 +1715,8 @@ static void uec_configure_serdes(struct net_device *dev)
        phy_write(tbiphy, ENET_TBI_MII_TBICON, TBICON_CLK_SELECT);
 
        phy_write(tbiphy, ENET_TBI_MII_CR, TBICR_SETTINGS);
+
+       put_device(&tbiphy->dev);
 }
 
 /* Configure the PHY for dev.