Skip to content

Commit

Permalink
phy: phy-core: use the np present in of_phandle_args to get the PHY
Browse files Browse the repository at this point in the history
Instead of using the node pointer of the PHY provider and then scanning its
child nodes to get a reference to the PHY, directly use the node pointer
present in of_phandle_args to get a reference to the PHY.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
  • Loading branch information
Kishon Vijay Abraham I committed Nov 12, 2014
1 parent 28ba384 commit 491e049
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/phy/phy-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,21 +414,13 @@ struct phy *of_phy_simple_xlate(struct device *dev, struct of_phandle_args
{
struct phy *phy;
struct class_dev_iter iter;
struct device_node *node = dev->of_node;
struct device_node *child;

class_dev_iter_init(&iter, phy_class, NULL, NULL);
while ((dev = class_dev_iter_next(&iter))) {
phy = to_phy(dev);
if (node != phy->dev.of_node) {
for_each_child_of_node(node, child) {
if (child == phy->dev.of_node)
goto phy_found;
}
if (args->np != phy->dev.of_node)
continue;
}

phy_found:
class_dev_iter_exit(&iter);
return phy;
}
Expand Down

0 comments on commit 491e049

Please sign in to comment.