Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: core: Simplify with scoped for each OF child loop

Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20251224124407.208354-5-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Vinod Koul
175b46f3 943dbe14

+2 -5
+2 -5
drivers/phy/phy-core.c
··· 138 138 static struct phy_provider *of_phy_provider_lookup(struct device_node *node) 139 139 { 140 140 struct phy_provider *phy_provider; 141 - struct device_node *child; 142 141 143 142 list_for_each_entry(phy_provider, &phy_provider_list, list) { 144 143 if (phy_provider->dev->of_node == node) 145 144 return phy_provider; 146 145 147 - for_each_child_of_node(phy_provider->children, child) 148 - if (child == node) { 149 - of_node_put(child); 146 + for_each_child_of_node_scoped(phy_provider->children, child) 147 + if (child == node) 150 148 return phy_provider; 151 - } 152 149 } 153 150 154 151 return ERR_PTR(-EPROBE_DEFER);