aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorDavid Daney <david.daney@cavium.com>2012-05-02 11:16:37 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-07 22:58:09 -0400
commit251060220021283eef3652145a41f5b26db97ce5 (patch)
treee04d2a1695e19e959873cf8a6d571a925ca59cc5 /drivers/of
parent7dc2ce5f12cb5d166140820d5063027dc2449ac1 (diff)
netdev/of/phy: New function: of_mdio_find_bus().
Add of_mdio_find_bus() which allows an mii_bus to be located given its associated the device tree node. This is needed by the follow-on patch to add a driver for MDIO bus multiplexers. The of_mdiobus_register() function is modified so that the device tree node is recorded in the mii_bus. Then we can find it again by iterating over all mdio_bus_class devices. Because the OF device tree has now become an integral part of the kernel, this can live in mdio_bus.c (which contains the needed mdio_bus_class structure) instead of of_mdio.c. Signed-off-by: David Daney <david.daney@cavium.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/of_mdio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index 483c0adcad87..2574abde8d99 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -45,6 +45,8 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
45 for (i=0; i<PHY_MAX_ADDR; i++) 45 for (i=0; i<PHY_MAX_ADDR; i++)
46 mdio->irq[i] = PHY_POLL; 46 mdio->irq[i] = PHY_POLL;
47 47
48 mdio->dev.of_node = np;
49
48 /* Register the MDIO bus */ 50 /* Register the MDIO bus */
49 rc = mdiobus_register(mdio); 51 rc = mdiobus_register(mdio);
50 if (rc) 52 if (rc)