Test if we already found a phy device on an address earlier and return it if it exists. This makes it possible to call mdiobus_scan multiple times. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- drivers/net/phy/mdio_bus.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index b49f714..5025e3f 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -101,6 +101,9 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr) { struct phy_device *phydev; + if (bus->phy_map[addr]) + return bus->phy_map[addr]; + phydev = get_phy_device(bus, addr); if (IS_ERR(phydev) || phydev == NULL) return phydev; -- 1.7.10.4 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox