aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2014-10-31 04:34:20 -0400
committerKishon Vijay Abraham I <kishon@ti.com>2014-11-12 08:10:13 -0500
commit491e049064a4ea69ba4b35bdf614f12bc762a717 (patch)
treebdf4fb0cf3150f2e52da2aa0c1a521a9f9ecbede /drivers/phy
parent28ba384dc5e42a23328dca7e5e72d19e2dd4c9ce (diff)
phy: phy-core: use the np present in of_phandle_args to get the PHY
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>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-core.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index ff5eec5af817..1606ce9805d0 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -414,21 +414,13 @@ struct phy *of_phy_simple_xlate(struct device *dev, struct of_phandle_args
414{ 414{
415 struct phy *phy; 415 struct phy *phy;
416 struct class_dev_iter iter; 416 struct class_dev_iter iter;
417 struct device_node *node = dev->of_node;
418 struct device_node *child;
419 417
420 class_dev_iter_init(&iter, phy_class, NULL, NULL); 418 class_dev_iter_init(&iter, phy_class, NULL, NULL);
421 while ((dev = class_dev_iter_next(&iter))) { 419 while ((dev = class_dev_iter_next(&iter))) {
422 phy = to_phy(dev); 420 phy = to_phy(dev);
423 if (node != phy->dev.of_node) { 421 if (args->np != phy->dev.of_node)
424 for_each_child_of_node(node, child) {
425 if (child == phy->dev.of_node)
426 goto phy_found;
427 }
428 continue; 422 continue;
429 }
430 423
431phy_found:
432 class_dev_iter_exit(&iter); 424 class_dev_iter_exit(&iter);
433 return phy; 425 return phy;
434 } 426 }