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.

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 <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Krzysztof Kozlowski and committed by
Miquel Raynal
8f51b6be 3b960598

+1 -3
+1 -3
drivers/mtd/nand/raw/vf610_nfc.c
··· 810 810 struct vf610_nfc *nfc; 811 811 struct mtd_info *mtd; 812 812 struct nand_chip *chip; 813 - struct device_node *child; 814 813 int err; 815 814 int irq; 816 815 ··· 843 844 if (!nfc->variant) 844 845 return -ENODEV; 845 846 846 - for_each_available_child_of_node(nfc->dev->of_node, child) { 847 + for_each_available_child_of_node_scoped(nfc->dev->of_node, child) { 847 848 if (of_device_is_compatible(child, "fsl,vf610-nfc-nandcs")) { 848 849 849 850 if (nand_get_flash_node(chip)) { 850 851 dev_err(nfc->dev, 851 852 "Only one NAND chip supported!\n"); 852 - of_node_put(child); 853 853 return -EINVAL; 854 854 } 855 855