[Skiboot] [PATCH v10 02/17] core/fdt: Split flatten_dt_node()

Gavin Shan gwshan at linux.vnet.ibm.com
Tue May 3 15:04:27 AEST 2016

We need unflatten the child device nodes of the specified device
node at PCI hotplugging time. The FDT blob that represents device
sub-tree is transfered to the kernel with the specified (root)
device node excluded. More changes will be introduced for that
in subsequent patches. The flatten_dt_node() implementation
will become complex.

In order to avoid the complexity as mentioned above. 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)
-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);
-	list_for_each(&root->properties, p, list) {
+	list_for_each(&dn->properties, p, list) {
 		if (strstarts(p->name, DT_PRIVATE))
 #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);
+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);
+	flatten_dt_properties(root);
 	list_for_each(&root->children, i, list) {

More information about the Skiboot mailing list