diff mbox series

[XEN,RFC,v2,04/12] libfdt: Add fdt_ prefix to overlay_get_target()

Message ID 1636441347-133850-5-git-send-email-fnu.vikram@xilinx.com (mailing list archive)
State New, archived
Headers show
Series dynamic node programming using overlay dtbo | expand

Commit Message

Vikram Garhwal Nov. 9, 2021, 7:02 a.m. UTC
Add fdt_ prefix to overlay_get_target() and remove static type. This is done to
get the target path for all the overlay nodes. This is useful to find which
nodes are to be added/removed in dt_host.

Also, sending this patch to dtc mailing list to avoid the divergence.

Signed-off-by: Vikram Garhwal <fnu.vikram@xilinx.com>
---
 xen/common/libfdt/fdt_overlay.c | 12 ++++++------
 xen/include/xen/libfdt/libfdt.h |  3 +++
 2 files changed, 9 insertions(+), 6 deletions(-)

Comments

Julien Grall Dec. 22, 2021, 2:07 p.m. UTC | #1
Hi,

On 09/11/2021 08:02, Vikram Garhwal wrote:
> Add fdt_ prefix to overlay_get_target() and remove static type. This is done to
> get the target path for all the overlay nodes. This is useful to find which
> nodes are to be added/removed in dt_host.
> 
> Also, sending this patch to dtc mailing list to avoid the divergence.

Can you add a link to the thread on the DTC ML?

Cheers,
diff mbox series

Patch

diff --git a/xen/common/libfdt/fdt_overlay.c b/xen/common/libfdt/fdt_overlay.c
index 7b95e2b..194f51b 100644
--- a/xen/common/libfdt/fdt_overlay.c
+++ b/xen/common/libfdt/fdt_overlay.c
@@ -42,13 +42,13 @@  static uint32_t overlay_get_target_phandle(const void *fdto, int fragment)
 }
 
 /**
- * overlay_get_target - retrieves the offset of a fragment's target
+ * fdt_overlay_get_target - retrieves the offset of a fragment's target
  * @fdt: Base device tree blob
  * @fdto: Device tree overlay blob
  * @fragment: node offset of the fragment in the overlay
  * @pathp: pointer which receives the path of the target (or NULL)
  *
- * overlay_get_target() retrieves the target offset in the base
+ * fdt_overlay_get_target() retrieves the target offset in the base
  * device tree of a fragment, no matter how the actual targeting is
  * done (through a phandle or a path)
  *
@@ -56,7 +56,7 @@  static uint32_t overlay_get_target_phandle(const void *fdto, int fragment)
  *      the targeted node offset in the base device tree
  *      Negative error code on error
  */
-static int overlay_get_target(const void *fdt, const void *fdto,
+int fdt_overlay_get_target(const void *fdt, const void *fdto,
 			      int fragment, char const **pathp)
 {
 	uint32_t phandle;
@@ -638,7 +638,7 @@  static int overlay_merge(void *fdt, void *fdto)
 		if (overlay < 0)
 			return overlay;
 
-		target = overlay_get_target(fdt, fdto, fragment, NULL);
+		target = fdt_overlay_get_target(fdt, fdto, fragment, NULL);
 		if (target < 0)
 			return target;
 
@@ -781,7 +781,7 @@  static int overlay_symbol_update(void *fdt, void *fdto)
 			return -FDT_ERR_BADOVERLAY;
 
 		/* get the target of the fragment */
-		ret = overlay_get_target(fdt, fdto, fragment, &target_path);
+		ret = fdt_overlay_get_target(fdt, fdto, fragment, &target_path);
 		if (ret < 0)
 			return ret;
 		target = ret;
@@ -803,7 +803,7 @@  static int overlay_symbol_update(void *fdt, void *fdto)
 
 		if (!target_path) {
 			/* again in case setprop_placeholder changed it */
-			ret = overlay_get_target(fdt, fdto, fragment, &target_path);
+			ret = fdt_overlay_get_target(fdt, fdto, fragment, &target_path);
 			if (ret < 0)
 				return ret;
 			target = ret;
diff --git a/xen/include/xen/libfdt/libfdt.h b/xen/include/xen/libfdt/libfdt.h
index c71689e..1f549d0 100644
--- a/xen/include/xen/libfdt/libfdt.h
+++ b/xen/include/xen/libfdt/libfdt.h
@@ -2115,6 +2115,9 @@  int fdt_overlay_apply(void *fdt, void *fdto);
 
 const char *fdt_strerror(int errval);
 
+int fdt_overlay_get_target(const void *fdt, const void *fdto, int fragment,
+                           char const **pathp);
+
 #ifdef __cplusplus
 }
 #endif