Commit 8f51b6be authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Miquel Raynal
Browse files

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: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 3b960598
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;
			}