Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 167876
b: refs/heads/master
c: 08a7963
h: refs/heads/master
v: v3
  • Loading branch information
Jérôme Pouiller authored and Grant Likely committed Oct 15, 2009
1 parent f992944 commit 518a6b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 830cb6fafc12af6c105aaaf794543e4423ca79c3
refs/heads/master: 08a7963aad03b5cf515f1e9c35e0ac9eb7dae072
13 changes: 7 additions & 6 deletions trunk/drivers/of/of_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 518a6b1

Please sign in to comment.