From 251060220021283eef3652145a41f5b26db97ce5 Mon Sep 17 00:00:00 2001 From: David Daney Date: Wed, 2 May 2012 15:16:37 +0000 Subject: 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 Cc: Grant Likely Cc: "David S. Miller" Signed-off-by: David S. Miller --- drivers/of/of_mdio.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/of/of_mdio.c') 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) for (i=0; iirq[i] = PHY_POLL; + mdio->dev.of_node = np; + /* Register the MDIO bus */ rc = mdiobus_register(mdio); if (rc) -- cgit v1.2.3