net: fix circular dependency in of_mdio code
Commit86f6cf4127
(net: of_mdio: add of_mdiobus_link_phydev()) introduced a circular dependency between libphy and of_mdio. depmod: ERROR: <modroot>/kernel/drivers/net/phy/libphy.ko in dependency cycle! depmod: ERROR: <modroot>/kernel/drivers/of/of_mdio.ko in dependency cycle! The problem is that of_mdio.c references &mdio_bus_type and libphy now references of_mdiobus_link_phydev. Fix this by not exporting of_mdiobus_link_phydev() from of_mdio.ko. Make it a static function in mdio_bus.c instead. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Jeff Mahoney <jeffm@suse.com> Fixes:86f6cf4127
(net: of_mdio: add of_mdiobus_link_phydev()) Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
eb608d2b99
commit
d9daa24720
@@ -182,40 +182,6 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
|
||||
}
|
||||
EXPORT_SYMBOL(of_mdiobus_register);
|
||||
|
||||
/**
|
||||
* of_mdiobus_link_phydev - Find a device node for a phy
|
||||
* @mdio: pointer to mii_bus structure
|
||||
* @phydev: phydev for which the of_node pointer should be set
|
||||
*
|
||||
* Walk the list of subnodes of a mdio bus and look for a node that matches the
|
||||
* phy's address with its 'reg' property. If found, set the of_node pointer for
|
||||
* the phy. This allows auto-probed pyh devices to be supplied with information
|
||||
* passed in via DT.
|
||||
*/
|
||||
void of_mdiobus_link_phydev(struct mii_bus *mdio,
|
||||
struct phy_device *phydev)
|
||||
{
|
||||
struct device *dev = &phydev->dev;
|
||||
struct device_node *child;
|
||||
|
||||
if (dev->of_node || !mdio->dev.of_node)
|
||||
return;
|
||||
|
||||
for_each_available_child_of_node(mdio->dev.of_node, child) {
|
||||
int addr;
|
||||
|
||||
addr = of_mdio_parse_addr(&mdio->dev, child);
|
||||
if (addr < 0)
|
||||
continue;
|
||||
|
||||
if (addr == phydev->addr) {
|
||||
dev->of_node = child;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(of_mdiobus_link_phydev);
|
||||
|
||||
/* Helper function for of_phy_find_device */
|
||||
static int of_phy_match(struct device *dev, void *phy_np)
|
||||
{
|
||||
|
Reference in New Issue
Block a user