Skip to content

Commit fa19f64

Browse files
robherringgregkh
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) <[email protected]> Reviewed-by: Clément Léger <[email protected]> Cc: [email protected] Fixes: 76d2a04 ("RISC-V: Init and Halt Code") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 625a90b commit fa19f64

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)