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.

bus: qcom-ebi2: 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: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260102125030.65186-3-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Bjorn Andersson
9c252f3c 6c4bbcda

+2 -5
+2 -5
drivers/bus/qcom-ebi2.c
··· 292 292 static int qcom_ebi2_probe(struct platform_device *pdev) 293 293 { 294 294 struct device_node *np = pdev->dev.of_node; 295 - struct device_node *child; 296 295 struct device *dev = &pdev->dev; 297 296 struct resource *res; 298 297 void __iomem *ebi2_base; ··· 347 348 writel(val, ebi2_base); 348 349 349 350 /* Walk over the child nodes and see what chipselects we use */ 350 - for_each_available_child_of_node(np, child) { 351 + for_each_available_child_of_node_scoped(np, child) { 351 352 u32 csindex; 352 353 353 354 /* Figure out the chipselect */ 354 355 ret = of_property_read_u32(child, "reg", &csindex); 355 - if (ret) { 356 - of_node_put(child); 356 + if (ret) 357 357 return ret; 358 - } 359 358 360 359 if (csindex > 5) { 361 360 dev_err(dev,