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.

mfd: core: 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>
Link: https://patch.msgid.link/20251224124456.208529-3-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Lee Jones
cd18e9af 541b1e86

+1 -3
+1 -3
drivers/mfd/mfd-core.c
··· 146 146 { 147 147 struct resource *res; 148 148 struct platform_device *pdev; 149 - struct device_node *np = NULL; 150 149 struct mfd_of_node_entry *of_entry, *tmp; 151 150 bool disabled = false; 152 151 int ret = -ENOMEM; ··· 183 184 goto fail_res; 184 185 185 186 if (IS_ENABLED(CONFIG_OF) && parent->of_node && cell->of_compatible) { 186 - for_each_child_of_node(parent->of_node, np) { 187 + for_each_child_of_node_scoped(parent->of_node, np) { 187 188 if (of_device_is_compatible(np, cell->of_compatible)) { 188 189 /* Skip 'disabled' devices */ 189 190 if (!of_device_is_available(np)) { ··· 194 195 ret = mfd_match_of_node_to_dev(pdev, np, cell); 195 196 if (ret == -EAGAIN) 196 197 continue; 197 - of_node_put(np); 198 198 if (ret) 199 199 goto fail_alias; 200 200