dtc: Make -Idts -Odts preserve node/property labels
This patch changes -Odts mode output so that labels on properties, nodes and memreserve entries in input source are preserved in the output.
Preserving labels within property values is trickier - another patch coming later.
Signed-off-by David Gibson <[email protected]>
treesource.c +8 -2
@@ -176,6 +176,8 @@ static void write_tree_source_node(FILEstruct node *child;write_prefix (f, level); +if (tree->label) +fprintf (f,"%s: " , tree->label);if (tree->name && (*tree->name))fprintf (f,"%s {\n" , tree->name);else
@@ -184,8 +186,10 @@ static void write_tree_source_node(FILEfor_each_property (tree, prop) {enum proptype type; -write_prefix (f, level); -fprintf (f,"\t%s" , prop->name); +write_prefix (f, level+1 ); +if (prop->label) +fprintf (f,"%s: " , prop->label); +fprintf (f,"%s" , prop->name); type =guess_type (prop);switch (type) {
@@ -220,6 +224,8 @@ void dt_to_source(FILE *f, struct boot_istruct reserve_info *re;for (re = bi->reservelist; re; re = re->next) { +if (re->label) +fprintf (f,"%s: " , re->label);fprintf (f,"/memreserve/\t%016llx-%016llx;\n" , (unsigned long long )re->re.address, (unsigned long long )(re->re.address + re->re.size -1 ));
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Jon Loeliger
AppliedSo, like, the other day David Gibson mumbled:
Quoted 8 lines
This patch changes -Odts mode output so that labels on properties, nodes and memreserve entries in input source are preserved in the output.
Preserving labels within property values is trickier - another patch coming later.
Signed-off-by David Gibson <[email protected]>
Applied.
jdl