diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-30 17:12:48 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-11-07 09:00:19 +0100 |
commit | 89dfe2d2af87f1b803f611d986d4ef383b6ad964 (patch) | |
tree | fb96cf2733da1ba9686a414a3cc32854229e1777 /drivers/net/phy/phy.c | |
parent | 745c16db7e1cc5f724be0120b811db03878d746d (diff) | |
download | barebox-89dfe2d2af87f1b803f611d986d4ef383b6ad964.tar.gz barebox-89dfe2d2af87f1b803f611d986d4ef383b6ad964.tar.xz |
mdiobus: do not scan the bus at registration time
Scanning the bus can take some time. If we do not need the ethernet
device, this is unnecessary, so delay the scan until the phy device
iactually is needed.
Andread Pretzsch: Fixup bug in scanning for all devices.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 88c3ff7723..547e2690a7 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -154,7 +154,7 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr, if (!edev->phydev) { if (addr >= 0) { - dev = bus->phy_map[addr]; + dev = mdiobus_scan(bus, addr); if (!dev) { ret = -EIO; goto fail; @@ -169,7 +169,7 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr, goto fail; } else { for (i = 0; i < PHY_MAX_ADDR && !edev->phydev; i++) { - dev = bus->phy_map[i]; + dev = mdiobus_scan(bus, i); if (!dev || dev->attached_dev) continue; |