[RFC PATCH 53/77] dtc: Rename add_orphan_node() to plugin_add_orphan_node()

Herve Codina posted 77 patches 3 weeks, 6 days ago
[RFC PATCH 53/77] dtc: Rename add_orphan_node() to plugin_add_orphan_node()
Posted by Herve Codina 3 weeks, 6 days ago
add_orphan_node() is used when a orphan node is parsed in a plugin
(overlay) device-tree.

This function creates some device-tree nodes (/fragment@n/__overlay__)
in order to merge the parsed orphan node.

This is specific to plugin device-trees and cannot be used for addon
device-trees.

In order to clarify that add_orphan_node() is specific to plugin
device-trees and to prepare the support for orphan node parsing
in the addon context, rename current add_orphan_node() to
plugin_add_orphan_node().

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 dtc-parser.y | 6 +++---
 dtc.h        | 3 ++-
 livetree.c   | 3 ++-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/dtc-parser.y b/dtc-parser.y
index 626a232..2b5b3c4 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -245,7 +245,7 @@ devicetree:
 				ERROR(&@2, "Label or path %s not found", $1);
 			else if (is_ref_relative($1))
 				ERROR(&@2, "Label-relative reference %s not supported in plugin", $1);
-			$$ = add_orphan_node(
+			$$ = plugin_add_orphan_node(
 					name_node(build_node(NULL, NULL, NULL, NULL),
 						  ""),
 					$2, $1);
@@ -269,7 +269,7 @@ devicetree:
 			if (last_header_flags & DTSF_PLUGIN) {
 				if (is_ref_relative($2))
 					ERROR(&@2, "Label-relative reference %s not supported in plugin", $2);
-				add_orphan_node($1, $3, $2);
+				plugin_add_orphan_node($1, $3, $2);
 			} else {
 				struct node *target = parser_get_node_by_ref($1, $2);
 
@@ -288,7 +288,7 @@ devicetree:
 				merge_nodes(target, $3);
 			} else {
 				if (last_header_flags & DTSF_PLUGIN)
-					add_orphan_node($1, $3, $2);
+					plugin_add_orphan_node($1, $3, $2);
 				else
 					ERROR(&@2, "Label or path %s not found", $2);
 			}
diff --git a/dtc.h b/dtc.h
index 399beee..e463756 100644
--- a/dtc.h
+++ b/dtc.h
@@ -305,7 +305,8 @@ struct node *omit_node_if_unused(struct node *node);
 struct node *reference_node(struct node *node);
 struct node *chain_node(struct node *first, struct node *list);
 struct node *merge_nodes(struct node *old_node, struct node *new_node);
-struct node *add_orphan_node(struct node *old_node, struct node *new_node, char *ref);
+struct node *plugin_add_orphan_node(struct node *old_node, struct node *new_node,
+				    char *ref);
 
 void add_property(struct node *node, struct property *prop);
 void delete_property_by_name(struct node *node, char *name);
diff --git a/livetree.c b/livetree.c
index 52c55be..a21dfc1 100644
--- a/livetree.c
+++ b/livetree.c
@@ -319,7 +319,8 @@ struct node *merge_nodes(struct node *old_node, struct node *new_node)
 	return old_node;
 }
 
-struct node * add_orphan_node(struct node *dt, struct node *new_node, char *ref)
+struct node *plugin_add_orphan_node(struct node *dt, struct node *new_node,
+				    char *ref)
 {
 	static unsigned int next_orphan_fragment = 0;
 	struct node *node;
-- 
2.52.0