Commit 0d5a213c authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Vinod Koul
Browse files

phy: ti: j721e-wiz: Simplify with scoped for each OF child loop



Use scoped for_each_child_of_node_scoped() when iterating over device
nodes to make code a bit simpler.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240826-phy-of-node-scope-v1-11-5b4d82582644@linaro.org


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent afd7aaf3
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1404,7 +1404,7 @@ MODULE_DEVICE_TABLE(of, wiz_id_table);

static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz)
{
	struct device_node *serdes, *subnode;
	struct device_node *serdes;

	serdes = of_get_child_by_name(dev->of_node, "serdes");
	if (!serdes) {
@@ -1412,7 +1412,7 @@ static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz)
		return -EINVAL;
	}

	for_each_child_of_node(serdes, subnode) {
	for_each_child_of_node_scoped(serdes, subnode) {
		u32 reg, num_lanes = 1, phy_type = PHY_NONE;
		int ret, i;

@@ -1422,7 +1422,6 @@ static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz)

		ret = of_property_read_u32(subnode, "reg", &reg);
		if (ret) {
			of_node_put(subnode);
			dev_err(dev,
				"%s: Reading \"reg\" from \"%s\" failed: %d\n",
				__func__, subnode->name, ret);