From: Vladimir Zapolskiy Date: Mon, 5 Sep 2011 07:24:07 +0000 (+0000) Subject: phylib: reset mii bus only if reset handler is registered X-Git-Tag: v2011.09-rc1~17 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3a77218a256edbe201112a39beeed8adcabae3f;p=pandora-u-boot.git 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 Acked-by: Detlev Zundel --- diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index ce69c19536..8da7688d70 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -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);