diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-10-28 09:56:18 +1100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-10-28 09:56:18 +1100 |
commit | 40578fca24e7f777f3da7a693b030ae28ef7e486 (patch) | |
tree | ed0541f857882f647bfc97e03d83371b8f4698a6 /drivers/of | |
parent | 4f917ba3d5ee9c98d60fa357e799942df8412de3 (diff) | |
parent | 4bdf0bb7d64cf672199519b3d808e2a82f5b59e9 (diff) |
Merge commit 'gcl/merge' into merge
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/of_mdio.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index bacaa536fd51..4b22ba568b19 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c @@ -97,6 +97,12 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) } EXPORT_SYMBOL(of_mdiobus_register); +/* Helper function for of_phy_find_device */ +static int of_phy_match(struct device *dev, void *phy_np) +{ + return dev_archdata_get_node(&dev->archdata) == phy_np; +} + /** * of_phy_find_device - Give a PHY node, find the phy_device * @phy_np: Pointer to the phy's device tree node @@ -106,15 +112,10 @@ EXPORT_SYMBOL(of_mdiobus_register); struct phy_device *of_phy_find_device(struct device_node *phy_np) { struct device *d; - int match(struct device *dev, void *phy_np) - { - return dev_archdata_get_node(&dev->archdata) == phy_np; - } - if (!phy_np) return NULL; - d = bus_find_device(&mdio_bus_type, NULL, phy_np, match); + d = bus_find_device(&mdio_bus_type, NULL, phy_np, of_phy_match); return d ? to_phy_device(d) : NULL; } EXPORT_SYMBOL(of_phy_find_device); |