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: qcom: 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: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Krzysztof Kozlowski and committed by
Miquel Raynal
42983837 c522c198

+3 -5
+3 -5
drivers/mtd/nand/raw/qcom_nandc.c
··· 2206 2206 static int qcom_probe_nand_devices(struct qcom_nand_controller *nandc) 2207 2207 { 2208 2208 struct device *dev = nandc->dev; 2209 - struct device_node *dn = dev->of_node, *child; 2209 + struct device_node *dn = dev->of_node; 2210 2210 struct qcom_nand_host *host; 2211 2211 int ret = -ENODEV; 2212 2212 2213 - for_each_available_child_of_node(dn, child) { 2213 + for_each_available_child_of_node_scoped(dn, child) { 2214 2214 host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL); 2215 - if (!host) { 2216 - of_node_put(child); 2215 + if (!host) 2217 2216 return -ENOMEM; 2218 - } 2219 2217 2220 2218 ret = qcom_nand_host_init_and_register(nandc, host, child); 2221 2219 if (ret) {