Skip to content

Commit

Permalink
net: phy: delay only if reset handler is registered
Browse files Browse the repository at this point in the history
With commit e3a7721 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>
  • Loading branch information
joerg-krause authored and jhershbe committed Aug 11, 2015
1 parent 2c171a2 commit 59370f3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,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);
}

Expand Down

0 comments on commit 59370f3

Please sign in to comment.