mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
dm: core: Add ofnode_read_string_count()
This provides a way to find the number of strings in a string list. Add it and also fix up the comment for ofnode_read_string_index(). Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
This commit is contained in:
@@ -260,6 +260,16 @@ int ofnode_read_string_index(ofnode node, const char *property, int index,
|
||||
}
|
||||
}
|
||||
|
||||
int ofnode_read_string_count(ofnode node, const char *property)
|
||||
{
|
||||
if (ofnode_is_np(node)) {
|
||||
return of_property_count_strings(ofnode_to_np(node), property);
|
||||
} else {
|
||||
return fdt_stringlist_count(gd->fdt_blob,
|
||||
ofnode_to_offset(node), property);
|
||||
}
|
||||
}
|
||||
|
||||
static void ofnode_from_fdtdec_phandle_args(struct fdtdec_phandle_args *in,
|
||||
struct ofnode_phandle_args *out)
|
||||
{
|
||||
|
Reference in New Issue
Block a user