]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
net: phy: delay only if reset handler is registered
authorJörg Krause <joerg.krause@embedded.rocks>
Wed, 15 Jul 2015 13:18:22 +0000 (15:18 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 06:17:42 +0000 (08:17 +0200)
With commit e3a77218a256edbe201112a39beeed8adcabae3f the MII bus is only
reset if a reset handler is registered. If there is no reset handler there
is no need to wait for a device to come out of the reset.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
drivers/net/phy/phy.c

index 106f9b01505f8c999de5d733307a5d52eed09cd0..f3b1b5c1ed915df0edb613616e43878626f6740f 100644 (file)
@@ -882,11 +882,13 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, unsigned phy_mask,
                phy_interface_t interface)
 {
        /* Reset the bus */
-       if (bus->reset)
+       if (bus->reset) {
                bus->reset(bus);
 
-       /* Wait 15ms to make sure the PHY has come out of hard reset */
-       udelay(15000);
+               /* Wait 15ms to make sure the PHY has come out of hard reset */
+               udelay(15000);
+       }
+
        return get_phy_device_by_mask(bus, phy_mask, interface);
 }