]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: sdhci-of-aspeed: Simplify with scoped for each OF child loop
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Wed, 24 Dec 2025 12:44:35 +0000 (13:44 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 23 Feb 2026 11:06:53 +0000 (12:06 +0100)
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>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-of-aspeed.c

index ca97b01996b1055ee674c8727b4f5a078573d6d0..4296def6943693c6af355c96e4693eb89263712b 100644 (file)
@@ -519,7 +519,7 @@ static struct platform_driver aspeed_sdhci_driver = {
 static int aspeed_sdc_probe(struct platform_device *pdev)
 
 {
-       struct device_node *parent, *child;
+       struct device_node *parent;
        struct aspeed_sdc *sdc;
        int ret;
 
@@ -548,12 +548,11 @@ static int aspeed_sdc_probe(struct platform_device *pdev)
        dev_set_drvdata(&pdev->dev, sdc);
 
        parent = pdev->dev.of_node;
-       for_each_available_child_of_node(parent, child) {
+       for_each_available_child_of_node_scoped(parent, child) {
                struct platform_device *cpdev;
 
                cpdev = of_platform_device_create(child, NULL, &pdev->dev);
                if (!cpdev) {
-                       of_node_put(child);
                        ret = -ENODEV;
                        goto err_clk;
                }