phylib: reset mii bus only if reset handler is registered

This change allows to cope with a mii bus device registered using
miiphy_register(), which doesn't assign a default reset handler.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Acked-by: Detlev Zundel <dzu@denx.de>
This commit is contained in:
Vladimir Zapolskiy 2011-09-05 07:24:07 +00:00 committed by Wolfgang Denk
parent 46d7274cdc
commit e3a77218a2
1 changed files with 2 additions and 1 deletions

View File

@ -692,7 +692,8 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr,
struct phy_device *phydev;
/* Reset the bus */
bus->reset(bus);
if (bus->reset)
bus->reset(bus);
/* Wait 15ms to make sure the PHY has come out of hard reset */
udelay(15000);