1
0
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:
Simon Glass
2017-06-12 06:21:28 -06:00
parent 7feccfdc45
commit 8c293d6ac9
3 changed files with 39 additions and 1 deletions

View File

@@ -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)
{