mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
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>
This commit is contained in:
parent
943dbe1470
commit
175b46f31f
|
|
@ -138,17 +138,14 @@ static struct phy *phy_find(struct device *dev, const char *con_id)
|
|||
static struct phy_provider *of_phy_provider_lookup(struct device_node *node)
|
||||
{
|
||||
struct phy_provider *phy_provider;
|
||||
struct device_node *child;
|
||||
|
||||
list_for_each_entry(phy_provider, &phy_provider_list, list) {
|
||||
if (phy_provider->dev->of_node == node)
|
||||
return phy_provider;
|
||||
|
||||
for_each_child_of_node(phy_provider->children, child)
|
||||
if (child == node) {
|
||||
of_node_put(child);
|
||||
for_each_child_of_node_scoped(phy_provider->children, child)
|
||||
if (child == node)
|
||||
return phy_provider;
|
||||
}
|
||||
}
|
||||
|
||||
return ERR_PTR(-EPROBE_DEFER);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user