X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=lib%2Ffdtdec_common.c;h=5775992ef3373f36b27bdf6b1d2e9c80044d6161;hb=c95c3ec025f46b6d65f87bc1010eae76c4152334;hp=63b704a3d719b178c79da4068a477aded2c80e9f;hpb=5f5620ab2679608f94b3a77e51c77d0a770103bd;p=oweals%2Fu-boot.git diff --git a/lib/fdtdec_common.c b/lib/fdtdec_common.c index 63b704a3d7..5775992ef3 100644 --- a/lib/fdtdec_common.c +++ b/lib/fdtdec_common.c @@ -1,16 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (c) 2014 * Heiko Schocher, DENX Software Engineering, hs@denx.de. * * Based on lib/fdtdec.c: * Copyright (c) 2011 The Chromium OS Authors. - * - * SPDX-License-Identifier: GPL-2.0+ */ #ifndef USE_HOSTCC #include -#include +#include #include #else #include "libfdt.h" @@ -54,3 +53,14 @@ unsigned int fdtdec_get_uint(const void *blob, int node, const char *prop_name, debug("(not found)\n"); return default_val; } + +int fdtdec_get_child_count(const void *blob, int node) +{ + int subnode; + int num = 0; + + fdt_for_each_subnode(subnode, blob, node) + num++; + + return num; +}