]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv: cacheinfo: Use of_property_present() for non-boolean properties
authorRob Herring <robh@kernel.org>
Mon, 4 Nov 2024 19:03:13 +0000 (13:03 -0600)
committerPalmer Dabbelt <palmer@rivosinc.com>
Fri, 14 Feb 2025 21:04:20 +0000 (13:04 -0800)
The use of of_property_read_bool() for non-boolean properties is
deprecated in favor of of_property_present() when testing for property
presence.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Clément Léger <cleger@rivosinc.com>
Cc: stable@vger.kernel.org
Fixes: 76d2a0493a17 ("RISC-V: Init and Halt Code")
Link: https://lore.kernel.org/r/20241104190314.270095-1-robh@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/cacheinfo.c

index 2d40736fc37cec788448d25c4ec5bdce802e581a..26b085dbdd073fbcaf2d581f43e72e4923a001d6 100644 (file)
@@ -108,11 +108,11 @@ int populate_cache_leaves(unsigned int cpu)
        if (!np)
                return -ENOENT;
 
-       if (of_property_read_bool(np, "cache-size"))
+       if (of_property_present(np, "cache-size"))
                ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
-       if (of_property_read_bool(np, "i-cache-size"))
+       if (of_property_present(np, "i-cache-size"))
                ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
-       if (of_property_read_bool(np, "d-cache-size"))
+       if (of_property_present(np, "d-cache-size"))
                ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
 
        prev = np;
@@ -125,11 +125,11 @@ int populate_cache_leaves(unsigned int cpu)
                        break;
                if (level <= levels)
                        break;
-               if (of_property_read_bool(np, "cache-size"))
+               if (of_property_present(np, "cache-size"))
                        ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
-               if (of_property_read_bool(np, "i-cache-size"))
+               if (of_property_present(np, "i-cache-size"))
                        ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
-               if (of_property_read_bool(np, "d-cache-size"))
+               if (of_property_present(np, "d-cache-size"))
                        ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
                levels = level;
        }