Skip to content

Commit def6d67

Browse files
robherringjfvogel
authored andcommitted
riscv: cacheinfo: Use of_property_present() for non-boolean properties
commit fb8179c upstream. 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: 76d2a04 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit fa19f64d6329da2c0389749a17faa2180b0876aa) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
1 parent afd325c commit def6d67

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/riscv/kernel/cacheinfo.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ int populate_cache_leaves(unsigned int cpu)
108108
if (!np)
109109
return -ENOENT;
110110

111-
if (of_property_read_bool(np, "cache-size"))
111+
if (of_property_present(np, "cache-size"))
112112
ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
113-
if (of_property_read_bool(np, "i-cache-size"))
113+
if (of_property_present(np, "i-cache-size"))
114114
ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
115-
if (of_property_read_bool(np, "d-cache-size"))
115+
if (of_property_present(np, "d-cache-size"))
116116
ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
117117

118118
prev = np;
@@ -125,11 +125,11 @@ int populate_cache_leaves(unsigned int cpu)
125125
break;
126126
if (level <= levels)
127127
break;
128-
if (of_property_read_bool(np, "cache-size"))
128+
if (of_property_present(np, "cache-size"))
129129
ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
130-
if (of_property_read_bool(np, "i-cache-size"))
130+
if (of_property_present(np, "i-cache-size"))
131131
ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
132-
if (of_property_read_bool(np, "d-cache-size"))
132+
if (of_property_present(np, "d-cache-size"))
133133
ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
134134
levels = level;
135135
}

0 commit comments

Comments
 (0)