diff options
author | Simon Glass <sjg@chromium.org> | 2013-01-21 12:59:18 -0800 |
---|---|---|
committer | Gerald Van Baren <vanbaren@cideas.com> | 2013-05-10 19:04:49 -0400 |
commit | e853b32424e1fbbbcf1a78e6ddd3e732abe72dc0 (patch) | |
tree | 1cab28ab7a4f3a185cd2bf331cb94d3122d2465f /include/libfdt.h | |
parent | 2988eac70ead3720f9ec85a239cd06b2f7246683 (diff) |
Export fdt_stringlist_contains()
This function is useful outside libfdt, so export it.
Ref: DTC commit b7aa300e
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'include/libfdt.h')
-rw-r--r-- | include/libfdt.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/libfdt.h b/include/libfdt.h index fc7f75b9ffa..b153cc31bfb 100644 --- a/include/libfdt.h +++ b/include/libfdt.h @@ -816,6 +816,20 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset, int fdt_node_offset_by_compatible(const void *fdt, int startoffset, const char *compatible); +/** + * fdt_stringlist_contains - check a string list property for a string + * @strlist: Property containing a list of strings to check + * @listlen: Length of property + * @str: String to search for + * + * This is a utility function provided for convenience. The list contains + * one or more strings, each terminated by \0, as is found in a device tree + * "compatible" property. + * + * @return: 1 if the string is found in the list, 0 not found, or invalid list + */ +int fdt_stringlist_contains(const char *strlist, int listlen, const char *str); + /**********************************************************************/ /* Write-in-place functions */ /**********************************************************************/ |