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: denali: 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
758916e2 f3701ba1

+2 -5
+2 -5
drivers/mtd/nand/raw/denali_dt.c
··· 115 115 struct denali_dt *dt; 116 116 const struct denali_dt_data *data; 117 117 struct denali_controller *denali; 118 - struct device_node *np; 119 118 int ret; 120 119 121 120 dt = devm_kzalloc(dev, sizeof(*dt), GFP_KERNEL); ··· 191 192 if (ret) 192 193 goto out_assert_rst; 193 194 194 - for_each_child_of_node(dev->of_node, np) { 195 + for_each_child_of_node_scoped(dev->of_node, np) { 195 196 ret = denali_dt_chip_init(denali, np); 196 - if (ret) { 197 - of_node_put(np); 197 + if (ret) 198 198 goto out_remove_denali; 199 - } 200 199 } 201 200 202 201 platform_set_drvdata(pdev, dt);