[PATCH 2/9] phy: ti: j721e-wiz: Get PHY properties only for "phy" subnode

From: Kishon Vijay Abraham I
Date: Mon Nov 02 2020 - 22:56:26 EST


"serdes" node (child node of WIZ) can have sub-nodes for representing links
or it can have sub-nodes for representing the various clocks within the
serdes. Instead of trying to read "reg" from every child node used for
assigning "lane_phy_type", read only if the child node's name is "phy".

Signed-off-by: Kishon Vijay Abraham I <kishon@xxxxxx>
---
drivers/phy/ti/phy-j721e-wiz.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c
index c9cfafe89cbf..d57d29382ce4 100644
--- a/drivers/phy/ti/phy-j721e-wiz.c
+++ b/drivers/phy/ti/phy-j721e-wiz.c
@@ -787,6 +787,9 @@ static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz)
u32 reg, num_lanes = 1, phy_type = PHY_NONE;
int ret, i;

+ if (!(of_node_name_eq(subnode, "phy")))
+ continue;
+
ret = of_property_read_u32(subnode, "reg", &reg);
if (ret) {
dev_err(dev,
--
2.17.1