Commit 08a7963a authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Grant Likely

of: Remove nested function

Some toolchains dislike nested function definition, so we define function match
outside of of_phy_find_device.
Signed-off-by: default avatarJérôme Pouiller <jezz@sysmic.org>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 830cb6fa
...@@ -97,6 +97,12 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) ...@@ -97,6 +97,12 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
} }
EXPORT_SYMBOL(of_mdiobus_register); 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 * of_phy_find_device - Give a PHY node, find the phy_device
* @phy_np: Pointer to the phy's device tree node * @phy_np: Pointer to the phy's device tree node
...@@ -106,15 +112,10 @@ EXPORT_SYMBOL(of_mdiobus_register); ...@@ -106,15 +112,10 @@ EXPORT_SYMBOL(of_mdiobus_register);
struct phy_device *of_phy_find_device(struct device_node *phy_np) struct phy_device *of_phy_find_device(struct device_node *phy_np)
{ {
struct device *d; struct device *d;
int match(struct device *dev, void *phy_np)
{
return dev_archdata_get_node(&dev->archdata) == phy_np;
}
if (!phy_np) if (!phy_np)
return NULL; 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; return d ? to_phy_device(d) : NULL;
} }
EXPORT_SYMBOL(of_phy_find_device); EXPORT_SYMBOL(of_phy_find_device);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment