]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mtd: rawnand: vf610: Simplify with scoped for each OF child loop
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Fri, 2 Jan 2026 12:49:33 +0000 (13:49 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 19 Jan 2026 10:13:43 +0000 (11:13 +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: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/vf610_nfc.c

index 1955dc50b40a403c5cc02066becc58640cba57d6..9940681810cff202929126f29f1a7d392a04d2c4 100644 (file)
@@ -810,7 +810,6 @@ static int vf610_nfc_probe(struct platform_device *pdev)
        struct vf610_nfc *nfc;
        struct mtd_info *mtd;
        struct nand_chip *chip;
-       struct device_node *child;
        int err;
        int irq;
 
@@ -844,13 +843,12 @@ static int vf610_nfc_probe(struct platform_device *pdev)
        if (!nfc->variant)
                return -ENODEV;
 
-       for_each_available_child_of_node(nfc->dev->of_node, child) {
+       for_each_available_child_of_node_scoped(nfc->dev->of_node, child) {
                if (of_device_is_compatible(child, "fsl,vf610-nfc-nandcs")) {
 
                        if (nand_get_flash_node(chip)) {
                                dev_err(nfc->dev,
                                        "Only one NAND chip supported!\n");
-                               of_node_put(child);
                                return -EINVAL;
                        }