]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: lmk04832: Simplify with scoped for each OF child loop
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Wed, 24 Dec 2025 11:22:40 +0000 (12:22 +0100)
committerStephen Boyd <sboyd@kernel.org>
Fri, 16 Jan 2026 02:48:53 +0000 (18:48 -0800)
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: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-lmk04832.c

index b2107b31efa28ee93e83639d220a8bcaaeab49e4..9bf86caad8298699c8208497fff31fecbfc1f07e 100644 (file)
@@ -1400,7 +1400,6 @@ static int lmk04832_probe(struct spi_device *spi)
 {
        const struct lmk04832_device_info *info;
        int rdbk_pin = RDBK_CLKIN_SEL1;
-       struct device_node *child;
        struct lmk04832 *lmk;
        u8 tmp[3];
        int ret;
@@ -1462,14 +1461,13 @@ static int lmk04832_probe(struct spi_device *spi)
        device_property_read_u32(lmk->dev, "ti,sysref-pulse-count",
                                 &lmk->sysref_pulse_cnt);
 
-       for_each_child_of_node(lmk->dev->of_node, child) {
+       for_each_child_of_node_scoped(lmk->dev->of_node, child) {
                int reg;
 
                ret = of_property_read_u32(child, "reg", &reg);
                if (ret) {
                        dev_err(lmk->dev, "missing reg property in child: %s\n",
                                child->full_name);
-                       of_node_put(child);
                        return ret;
                }