diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index d7d6d89..cda05af 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -26,6 +26,7 @@ #include #include #include +#include #define DEFAULT_GPIO_RESET_ASSERT 1000 /* us */ #define DEFAULT_GPIO_RESET_DEASSERT 1000 /* us */ @@ -179,8 +180,19 @@ /* Loop over the child nodes and register a phy_device for each one */ for_each_available_child_of_node(np, child) { - if (!of_mdiobus_child_is_phy(child)) + if (!of_mdiobus_child_is_phy(child)) { + if (of_get_property(child, "compatible", NULL)) { + if (!of_platform_device_create(child, + &mdio->dev)) { + dev_err(&mdio->dev, + "Failed to create device " + "for %s\n", + child->full_name); + } + } + continue; + } ret = of_property_read_u32(child, "reg", &addr); if (ret) { diff --git a/include/of.h b/include/of.h index 7fc4b77..184acb4 100644 --- a/include/of.h +++ b/include/of.h @@ -321,6 +321,12 @@ return -ENOSYS; } +static inline struct device_d *of_platform_device_create(struct device_node *np, + struct device_d *parent) +{ + return NULL; +} + static inline int of_n_addr_cells(struct device_node *np) { return 0;