@@ -217,7 +217,6 @@ EXPORT_SYMBOL(fwnode_mdiobus_child_is_phy);
int fwnode_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
{
struct device_node *child;
- bool scanphys = false;
int addr, rc;
if (!np)
@@ -247,10 +246,8 @@ int fwnode_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
/* Loop over the child nodes and register a phy_device for each phy */
for_each_available_child_of_node(np, child) {
addr = of_mdio_parse_addr(&mdio->dev, child);
- if (addr < 0) {
- scanphys = true;
+ if (addr < 0)
continue;
- }
if (of_mdiobus_child_is_phy(child))
rc = fwnode_mdiobus_register_phy(mdio,
@@ -267,40 +264,6 @@ int fwnode_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
goto unregister;
}
- if (!scanphys)
- return 0;
-
- /* auto scan for PHYs with empty reg property */
- for_each_available_child_of_node(np, child) {
- /* Skip PHYs with reg property set */
- if (of_find_property(child, "reg", NULL))
- continue;
-
- for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
- /* skip already registered PHYs */
- if (mdiobus_is_registered_device(mdio, addr))
- continue;
-
- /* be noisy to encourage people to set reg property */
- dev_info(&mdio->dev, "scan phy %pOFn at address %i\n",
- child, addr);
-
- if (of_mdiobus_child_is_phy(child)) {
- /* -ENODEV is the return code that PHYLIB has
- * standardized on to indicate that bus
- * scanning should continue.
- */
- rc = fwnode_mdiobus_register_phy(mdio,
- of_fwnode_handle(child),
- addr);
- if (!rc)
- break;
- if (rc != -ENODEV)
- goto unregister;
- }
- }
- }
-
return 0;
unregister:
When 'reg' property is missing from child MDIO nodes, an automatic scan is done to find phy devices that are present on the bus. Since the 'reg' property is marked as required in the mdio.yaml bindings, remove this legacy scan mechanism. Signed-off-by: Clément Léger <clement.leger@bootlin.com> --- drivers/net/mdio/fwnode_mdio.c | 39 +--------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-)