mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
phy: rockchip: usb: 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-4-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
fe4bc1a086
commit
943dbe1470
1 changed files with 2 additions and 5 deletions
|
|
@ -446,7 +446,6 @@ static int rockchip_usb_phy_probe(struct platform_device *pdev)
|
|||
struct device *dev = &pdev->dev;
|
||||
struct rockchip_usb_phy_base *phy_base;
|
||||
struct phy_provider *phy_provider;
|
||||
struct device_node *child;
|
||||
int err;
|
||||
|
||||
phy_base = devm_kzalloc(dev, sizeof(*phy_base), GFP_KERNEL);
|
||||
|
|
@ -472,12 +471,10 @@ static int rockchip_usb_phy_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(phy_base->reg_base);
|
||||
}
|
||||
|
||||
for_each_available_child_of_node(dev->of_node, child) {
|
||||
for_each_available_child_of_node_scoped(dev->of_node, child) {
|
||||
err = rockchip_usb_phy_init(phy_base, child);
|
||||
if (err) {
|
||||
of_node_put(child);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue