[U-Boot] [PATCH 2/2] dm: core: remove the duplicated function dm_ofnode_pre_reloc

Patrick Delaunay patrick.delaunay at st.com
Mon Feb 4 10:14:52 UTC 2019


The content dm_ofnode_pre_reloc() is identical with ofnode_pre_reloc()
defined in drivers/core/ofnode.c and used only one time
in drivers/core/lists.c:lists_bind_fdt().

So the function can be removed and directly call ofnode_pre_reloc.

Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
---

 drivers/core/lists.c |  2 +-
 drivers/core/util.c  | 26 --------------------------
 include/dm/util.h    | 27 ---------------------------
 3 files changed, 1 insertion(+), 54 deletions(-)

diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index a1f8284..67edf0f 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -173,7 +173,7 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
 			continue;
 
 		if (pre_reloc_only) {
-			if (!dm_ofnode_pre_reloc(node) &&
+			if (!ofnode_pre_reloc(node) &&
 			    !(entry->flags & DM_FLAG_PRE_RELOC))
 				return 0;
 		}
diff --git a/drivers/core/util.c b/drivers/core/util.c
index 6bedc8a..fa9ccbd 100644
--- a/drivers/core/util.c
+++ b/drivers/core/util.c
@@ -56,29 +56,3 @@ bool dm_fdt_pre_reloc(const void *blob, int offset)
 
 	return false;
 }
-
-bool dm_ofnode_pre_reloc(ofnode node)
-{
-	if (ofnode_read_bool(node, "u-boot,dm-pre-reloc"))
-		return true;
-	if (ofnode_read_bool(node, "u-boot,dm-pre-proper"))
-		return true;
-
-#ifdef CONFIG_TPL_BUILD
-	if (ofnode_read_bool(node, "u-boot,dm-tpl"))
-		return true;
-#elif defined(CONFIG_SPL_BUILD)
-	if (ofnode_read_bool(node, "u-boot,dm-spl"))
-		return true;
-#else
-	/*
-	 * In regular builds individual spl and tpl handling both
-	 * count as handled pre-relocation for later second init.
-	 */
-	if (ofnode_read_bool(node, "u-boot,dm-spl") ||
-	    ofnode_read_bool(node, "u-boot,dm-tpl"))
-		return true;
-#endif
-
-	return false;
-}
diff --git a/include/dm/util.h b/include/dm/util.h
index cbc209d..9b1128f 100644
--- a/include/dm/util.h
+++ b/include/dm/util.h
@@ -67,31 +67,4 @@ static inline void dm_dump_devres(void)
  */
 bool dm_fdt_pre_reloc(const void *blob, int offset);
 
-/**
- * Check if an of node should be or was bound before relocation.
- *
- * Devicetree nodes can be marked as needed to be bound
- * in the loader stages via special devicetree properties.
- *
- * Before relocation this function can be used to check if nodes
- * are required in either SPL or TPL stages.
- *
- * After relocation and jumping into the real U-Boot binary
- * it is possible to determine if a node was bound in one of
- * SPL/TPL stages.
- *
- * There are 4 settings currently in use
- * - u-boot,dm-pre-proper: U-Boot proper pre-relocation only
- * - u-boot,dm-pre-reloc: legacy and indicates any of TPL or SPL
- *   Existing platforms only use it to indicate nodes needed in
- *   SPL. Should probably be replaced by u-boot,dm-spl for
- *   existing platforms.
- * - u-boot,dm-spl: SPL and U-Boot pre-relocation
- * - u-boot,dm-tpl: TPL and U-Boot pre-relocation
- * @node: of node
- *
- * Returns true if node is needed in SPL/TL, false otherwise.
- */
-bool dm_ofnode_pre_reloc(ofnode node);
-
 #endif
-- 
2.7.4



More information about the U-Boot mailing list