From e853b32424e1fbbbcf1a78e6ddd3e732abe72dc0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 21 Jan 2013 12:59:18 -0800 Subject: Export fdt_stringlist_contains() This function is useful outside libfdt, so export it. Ref: DTC commit b7aa300e Signed-off-by: Simon Glass Acked-by: David Gibson --- include/libfdt.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/libfdt.h') diff --git a/include/libfdt.h b/include/libfdt.h index fc7f75b9ff..b153cc31bf 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 */ /**********************************************************************/ -- cgit v1.2.1