summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-08-26 17:33:50 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2014-10-11 01:05:59 +0200
commitdbb170e5d4f45d29a419c80e7a746cfbbf78d231 (patch)
treecbdd2280789eb80b2a4caca35dedc8845dfcbb52 /include
parentbf0c463942fbba4bf726865e65c9cc72551559e1 (diff)
fdt: Add a function to count strings
Given a device tree node and a property name, the fdt_count_strings() function counts the number of strings found in the property value. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/libfdt.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/libfdt.h b/include/libfdt.h
index a1ef1e15df3..cf97bf0b3b5 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -857,6 +857,15 @@ int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
*/
int fdt_stringlist_contains(const char *strlist, int listlen, const char *str);
+/**
+ * fdt_count_strings - count the number of strings in a string list
+ * @fdt: pointer to the device tree blob
+ * @node: offset of the node
+ * @property: name of the property containing the string list
+ * @return: the number of strings in the given property
+ */
+int fdt_count_strings(const void *fdt, int node, const char *property);
+
/**********************************************************************/
/* Read-only functions (addressing related) */
/**********************************************************************/