mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/4] of: Use dts syntax when printing devicetrees
Date: Sat, 27 Jul 2013 10:32:20 +0200	[thread overview]
Message-ID: <1374913941-17529-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1374913941-17529-1-git-send-email-s.hauer@pengutronix.de>

Our devicetree printing is close to correct dts syntax, so fix
some remaining differences:

- Use an equal sign instead of a colon to separate a poperty name and
  a value
- Add a semicolon at the end of properties
- Make sure we do not print a separator for empty properties

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/of/base.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 769b642..881ac3b 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1475,9 +1475,12 @@ void of_print_nodes(struct device_node *node, int indent)
 	list_for_each_entry(p, &node->properties, list) {
 		for (i = 0; i < indent + 1; i++)
 			printf("\t");
-		printf("%s: ", p->name);
-		of_print_property(p->value, p->length);
-		printf("\n");
+		printf("%s", p->name);
+		if (p->length) {
+			printf(" = ");
+			of_print_property(p->value, p->length);
+		}
+		printf(";\n");
 	}
 
 	list_for_each_entry(n, &node->children, parent_list) {
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-07-27  8:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-27  8:32 [PATCH] of fixes Sascha Hauer
2013-07-27  8:32 ` [PATCH 1/4] of: Use correct devicetree in of_print_cmdline Sascha Hauer
2013-07-27  8:32 ` [PATCH 2/4] of: net: Use correct devicetree in eth_of_fixup Sascha Hauer
2013-07-27  8:32 ` Sascha Hauer [this message]
2013-07-27  8:32 ` [PATCH 4/4] ARM: bootm: Print Kernel commandline unconditionally Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374913941-17529-4-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox