phy: cadence: Sierra: Create PHY only for "phy" or "link" sub-nodes
authorKishon Vijay Abraham I <kishon@ti.com>
Fri, 19 Mar 2021 12:41:18 +0000 (18:11 +0530)
committerVinod Koul <vkoul@kernel.org>
Wed, 31 Mar 2021 11:12:51 +0000 (16:42 +0530)
Cadence Sierra PHY driver registers PHY using devm_phy_create()
for all sub-nodes of Sierra device tree node. However Sierra device
tree node can have sub-nodes for the various clocks in addtion to the
PHY. Use devm_phy_create() only for nodes with name "phy" (or "link"
for old device tree) which represent the actual PHY.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Swapnil Jakhade <sjakhade@cadence.com>
Link: https://lore.kernel.org/r/20210319124128.13308-4-kishon@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/cadence/phy-cadence-sierra.c

index 19f32ae..f7ba0ed 100644 (file)
@@ -577,6 +577,10 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)
        for_each_available_child_of_node(dn, child) {
                struct phy *gphy;
 
+               if (!(of_node_name_eq(child, "phy") ||
+                     of_node_name_eq(child, "link")))
+                       continue;
+
                sp->phys[node].lnk_rst =
                        of_reset_control_array_get_exclusive(child);