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.

clk: imx: imx27: Simplify with scoped for each OF child loop

Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Acked-by: Abel Vesa <abelvesa@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260109-of-for-each-compatible-scoped-v3-8-c22fa2c0749a@oss.qualcomm.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Rob Herring (Arm)
f82fa1d5 3bf312f3

+2 -5
+2 -5
drivers/clk/imx/clk-imx27.c
··· 171 171 172 172 static void __init mx27_clocks_init_dt(struct device_node *np) 173 173 { 174 - struct device_node *refnp; 175 174 u32 fref = 26000000; /* default */ 176 175 177 - for_each_compatible_node(refnp, NULL, "fixed-clock") { 176 + for_each_compatible_node_scoped(refnp, NULL, "fixed-clock") { 178 177 if (!of_device_is_compatible(refnp, "fsl,imx-osc26m")) 179 178 continue; 180 179 181 - if (!of_property_read_u32(refnp, "clock-frequency", &fref)) { 182 - of_node_put(refnp); 180 + if (!of_property_read_u32(refnp, "clock-frequency", &fref)) 183 181 break; 184 - } 185 182 } 186 183 187 184 ccm = of_iomap(np, 0);