Skip to contentSkip to conversation

phy: phy-core: use the np present in of_phandle_args to get the PHY

PATCH Superseded Kishon Vijay Abraham I 1 participant 1 message Oct 30, 2014 Generic PHY framework

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/phy/phy-core.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/phy/phy-core.c +1 -7
index ff5eec5..25913f4 100644
@@ -420,15 +420,9 @@ struct phy *of_phy_simple_xlate(struct device *dev, struct of_phandle_args
 	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.node)
 			continue;
-		}
 
-phy_found:
 		class_dev_iter_exit(&iter);
 		return phy;
 	}
Signature · 1 line
1.7.9.5