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: ingenic: 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>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Krzysztof Kozlowski and committed by
Miquel Raynal
c522c198 758916e2

+1 -3
+1 -3
drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c
··· 438 438 struct platform_device *pdev) 439 439 { 440 440 struct device *dev = &pdev->dev; 441 - struct device_node *np; 442 441 int i = 0; 443 442 int ret; 444 443 int num_chips = of_get_child_count(dev->of_node); ··· 448 449 return -EINVAL; 449 450 } 450 451 451 - for_each_child_of_node(dev->of_node, np) { 452 + for_each_child_of_node_scoped(dev->of_node, np) { 452 453 ret = ingenic_nand_init_chip(pdev, nfc, np, i); 453 454 if (ret) { 454 455 ingenic_nand_cleanup_chips(nfc); 455 - of_node_put(np); 456 456 return ret; 457 457 } 458 458