summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerve Codina <herve.codina@bootlin.com>2026-05-13 11:16:45 +0300
committerMark Brown <broonie@kernel.org>2026-05-18 19:44:01 +0300
commit37dba38ac8d0910f31788368bce4d93aa4059040 (patch)
treed00c62a4f99152c1a650cb9bb99b3611a6d26c0f
parent5200f5f493f79f14bbdc349e402a40dfb32f23c8 (diff)
downloadlinux-37dba38ac8d0910f31788368bce4d93aa4059040.tar.xz
of: Introduce of_property_read_s32_index()
Signed integers can be read from single value properties using of_property_read_s32() but nothing exist to read signed integers from multi-value properties. Fix this lack adding of_property_read_s32_index(). Signed-off-by: Herve Codina <herve.codina@bootlin.com> Acked-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20260513081702.317117-2-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/linux/of.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index 959786f8f196..28153616e616 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -1476,6 +1476,13 @@ static inline int of_property_read_s32(const struct device_node *np,
return of_property_read_u32(np, propname, (u32*) out_value);
}
+static inline int of_property_read_s32_index(const struct device_node *np,
+ const char *propname, u32 index,
+ s32 *out_value)
+{
+ return of_property_read_u32_index(np, propname, index, (u32 *)out_value);
+}
+
#define of_for_each_phandle(it, err, np, ln, cn, cc) \
for (of_phandle_iterator_init((it), (np), (ln), (cn), (cc)), \
err = of_phandle_iterator_next(it); \