From patchwork Wed Apr 8 09:35:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 237392 List-Id: U-Boot discussion From: matthias.bgg at kernel.org (matthias.bgg at kernel.org) Date: Wed, 8 Apr 2020 11:35:27 +0200 Subject: [PATCH 1/2] libfdt: Make fdt_cells function accessible In-Reply-To: <20200408093528.24276-1-matthias.bgg@kernel.org> References: <20200408093528.24276-1-matthias.bgg@kernel.org> Message-ID: <20200408093528.24276-2-matthias.bgg@kernel.org> From: Matthias Brugger For reading address-cells and size-cells, the libfdt only provides functions which do not return in case the node does not provide the property. For traversing the DT to find the parent node which provides this property we will need to know that. Make fdt_cells accessible from outside of libfdt so that we can detect not present size- and address-cells properties in a node. Signed-off-by: Matthias Brugger --- scripts/dtc/libfdt/fdt_addresses.c | 2 +- scripts/dtc/libfdt/libfdt.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/dtc/libfdt/fdt_addresses.c b/scripts/dtc/libfdt/fdt_addresses.c index 9a82cd0ba2..ead9460e95 100644 --- a/scripts/dtc/libfdt/fdt_addresses.c +++ b/scripts/dtc/libfdt/fdt_addresses.c @@ -11,7 +11,7 @@ #include "libfdt_internal.h" -static int fdt_cells(const void *fdt, int nodeoffset, const char *name) +int fdt_cells(const void *fdt, int nodeoffset, const char *name) { const fdt32_t *c; uint32_t val; diff --git a/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h index fa63fffe28..b0eca12491 100644 --- a/scripts/dtc/libfdt/libfdt.h +++ b/scripts/dtc/libfdt/libfdt.h @@ -1121,6 +1121,8 @@ const char *fdt_stringlist_get(const void *fdt, int nodeoffset, */ #define FDT_MAX_NCELLS 4 +int fdt_cells(const void *fdt, int nodeoffset, const char *name); + /** * fdt_address_cells - retrieve address size for a bus represented in the tree * @fdt: pointer to the device tree blob