From: Krzysztof Kozlowski Date: Fri, 2 Jan 2026 12:49:33 +0000 (+0100) Subject: mtd: rawnand: vf610: Simplify with scoped for each OF child loop X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f51b6be269746d9a6abff4a5abc8b7aa680c659;p=thirdparty%2Fkernel%2Flinux.git mtd: rawnand: vf610: 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 Signed-off-by: Miquel Raynal --- diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c index 1955dc50b40a4..9940681810cff 100644 --- a/drivers/mtd/nand/raw/vf610_nfc.c +++ b/drivers/mtd/nand/raw/vf610_nfc.c @@ -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; }