[Skiboot] [PATCH v9 06/22] core/fdt: Split flatten_dt_node()

Gavin Shan gwshan at linux.vnet.ibm.com
Thu Nov 12 13:33:13 AEDT 2015


This moves the logic flattenning all properties of the specified
device node from flatten_dt_node() to flatten_dt_properties(). No
logical changes introduced.

Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
---
 core/fdt.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/core/fdt.c b/core/fdt.c
index a301f1f..6d3446e 100644
--- a/core/fdt.c
+++ b/core/fdt.c
@@ -113,24 +113,28 @@ static void dump_fdt(void)
 #endif
 }
 
-static void flatten_dt_node(const struct dt_node *root)
+static void flatten_dt_properties(const struct dt_node *dn)
 {
-	const struct dt_node *i;
 	const struct dt_property *p;
 
-#ifdef DEBUG_FDT
-	printf("FDT: node: %s\n", root->name);
-#endif
-
-	list_for_each(&root->properties, p, list) {
+	list_for_each(&dn->properties, p, list) {
 		if (strstarts(p->name, DT_PRIVATE))
 			continue;
 #ifdef DEBUG_FDT
-		printf("FDT:   prop: %s size: %ld\n", p->name, p->len);
+		printf("FDT: prop: %s size: %ld\n", p->name, p->len);
 #endif
 		dt_property(p);
 	}
+}
 
+static void flatten_dt_node(const struct dt_node *root)
+{
+	const struct dt_node *i;
+
+#ifdef DEBUG_FDT
+	printf("FDT: node: %s\n", root->name);
+#endif
+	flatten_dt_properties(root);
 	list_for_each(&root->children, i, list) {
 		dt_begin_node(i);
 		flatten_dt_node(i);
-- 
2.1.0



More information about the Skiboot mailing list