mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
net: macb: Use mdio child node for MDIO bus if it exists
This allows explicitly specifying which children are present on the mdio bus. Additionally, it allows for non-phy MDIO devices on the bus. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2579084400
commit
4d98bb0d7e
1 changed files with 11 additions and 0 deletions
|
@ -898,6 +898,17 @@ static int macb_mdiobus_register(struct macb *bp)
|
|||
{
|
||||
struct device_node *child, *np = bp->pdev->dev.of_node;
|
||||
|
||||
/* If we have a child named mdio, probe it instead of looking for PHYs
|
||||
* directly under the MAC node
|
||||
*/
|
||||
child = of_get_child_by_name(np, "mdio");
|
||||
if (np) {
|
||||
int ret = of_mdiobus_register(bp->mii_bus, child);
|
||||
|
||||
of_node_put(child);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (of_phy_is_fixed_link(np))
|
||||
return mdiobus_register(bp->mii_bus);
|
||||
|
||||
|
|
Loading…
Reference in a new issue