9
0
Fork 0

net: phy: move setting of phy_map to phy_register_device

The phy_map should be valid once a phy_device is registered. This
allows registering phys outside of mdiobus_scan.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-05-20 15:20:02 +02:00
parent 3fcb734639
commit b90dc18054
2 changed files with 2 additions and 2 deletions

View File

@ -114,8 +114,6 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr)
if (IS_ERR(phydev))
return phydev;
bus->phy_map[addr] = phydev;
return phydev;
}
EXPORT_SYMBOL(mdiobus_scan);

View File

@ -245,6 +245,8 @@ int phy_register_device(struct phy_device* dev)
if (ret)
return ret;
dev->bus->phy_map[dev->addr] = dev;
dev->registered = 1;
if (dev->dev.driver)