diff mbox

[U-Boot,1/1] net: phy: delay only if reset handler is registered

Message ID 1436966302-9733-1-git-send-email-joerg.krause@embedded.rocks
State Accepted
Delegated to: Joe Hershberger
Headers show

Commit Message

Jörg Krause July 15, 2015, 1:18 p.m. UTC
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 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Joe Hershberger Aug. 12, 2015, 7:28 p.m. UTC | #1
Hi Jörg,

On Wed, Jul 15, 2015 at 8:18 AM, Jörg Krause
<joerg.krause@embedded.rocks> wrote:
> 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>

Applied to u-boot-net, thanks!
-Joe
diff mbox

Patch

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 865abab..65c731a 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -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);
 }