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: 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>

authored by

Krzysztof Kozlowski and committed by
Vinod Koul
943dbe14 fe4bc1a0

+2 -5
+2 -5
drivers/phy/rockchip/phy-rockchip-usb.c
··· 446 446 struct device *dev = &pdev->dev; 447 447 struct rockchip_usb_phy_base *phy_base; 448 448 struct phy_provider *phy_provider; 449 - struct device_node *child; 450 449 int err; 451 450 452 451 phy_base = devm_kzalloc(dev, sizeof(*phy_base), GFP_KERNEL); ··· 471 472 return PTR_ERR(phy_base->reg_base); 472 473 } 473 474 474 - for_each_available_child_of_node(dev->of_node, child) { 475 + for_each_available_child_of_node_scoped(dev->of_node, child) { 475 476 err = rockchip_usb_phy_init(phy_base, child); 476 - if (err) { 477 - of_node_put(child); 477 + if (err) 478 478 return err; 479 - } 480 479 } 481 480 482 481 phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);