summaryrefslogtreecommitdiffstats
path: root/drivers/phy/phy-core.c
diff options
context:
space:
mode:
authorKishon Vijay Abraham I2014-10-31 09:34:20 +0100
committerKishon Vijay Abraham I2014-11-12 14:10:13 +0100
commit491e049064a4ea69ba4b35bdf614f12bc762a717 (patch)
treebdf4fb0cf3150f2e52da2aa0c1a521a9f9ecbede /drivers/phy/phy-core.c
parentphy: miphy28lp: Tune tx impedance across Soc cuts (diff)
downloadkernel-qcow2-linux-491e049064a4ea69ba4b35bdf614f12bc762a717.tar.gz
kernel-qcow2-linux-491e049064a4ea69ba4b35bdf614f12bc762a717.tar.xz
kernel-qcow2-linux-491e049064a4ea69ba4b35bdf614f12bc762a717.zip
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/phy-core.c')
-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
{
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;
}