summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>2025-09-12 09:32:19 +0100
committerVinod Koul <vkoul@kernel.org>2025-12-08 12:37:26 +0530
commit18223eececd66365c12275f09042e6fcb2ac5748 (patch)
treef40913c15024f5f9bc0b40c7c9d0a998a697ea88 /include/linux
parent3a8660878839faadb4f1a6dd72c3179c1df56787 (diff)
of: base: Add of_property_read_u8_index
Add support for of_property_read_u8_index(), simillar to others u16 and u32 variants. Having this helper makes the code more tidy in isome cases, specially when we are parsing multiple of these into data structures. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Tested-by: Alexey Klimov <alexey.klimov@linaro.org> # sm8550 Link: https://patch.msgid.link/20250912083225.228778-2-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/of.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index 121a288ca92d..57fb598b72d3 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -316,6 +316,9 @@ extern struct property *of_find_property(const struct device_node *np,
extern bool of_property_read_bool(const struct device_node *np, const char *propname);
extern int of_property_count_elems_of_size(const struct device_node *np,
const char *propname, int elem_size);
+extern int of_property_read_u8_index(const struct device_node *np,
+ const char *propname,
+ u32 index, u8 *out_value);
extern int of_property_read_u16_index(const struct device_node *np,
const char *propname,
u32 index, u16 *out_value);
@@ -646,6 +649,12 @@ static inline int of_property_count_elems_of_size(const struct device_node *np,
return -ENOSYS;
}
+static inline int of_property_read_u8_index(const struct device_node *np,
+ const char *propname, u32 index, u8 *out_value)
+{
+ return -ENOSYS;
+}
+
static inline int of_property_read_u16_index(const struct device_node *np,
const char *propname, u32 index, u16 *out_value)
{