From 4bf88ba76abb224b3ca258a2f502384ec6c86bd6 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 3 Sep 2021 15:16:18 +0200 Subject: fdtdec: Support retrieving the name of a carveout When retrieving a given carveout for a device, allow callers to query the name. This helps differentiating between carveouts when there are more than one. This is also useful when copying carveouts to help assign a meaningful name that cannot always be guessed. Signed-off-by: Thierry Reding Reviewed-by: Simon Glass Signed-off-by: Tom Warren --- include/fdtdec.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/fdtdec.h') diff --git a/include/fdtdec.h b/include/fdtdec.h index 23efbe710c..f961f03012 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -1038,14 +1038,16 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename, * * @param blob FDT blob * @param node name of a node - * @param name name of the property in the given node that contains + * @param prop_name name of the property in the given node that contains * the phandle for the carveout * @param index index of the phandle for which to read the carveout * @param carveout return location for the carveout information + * @param name return location for the carveout name * @return 0 on success or a negative error code on failure */ -int fdtdec_get_carveout(const void *blob, const char *node, const char *name, - unsigned int index, struct fdt_memory *carveout); +int fdtdec_get_carveout(const void *blob, const char *node, + const char *prop_name, unsigned int index, + struct fdt_memory *carveout, const char **name); /** * fdtdec_set_carveout() - sets a carveout region for a given node -- cgit v1.2.3