All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] fdtget: Fix multiple arg bug and add test for it
@ 2012-03-03  1:12 Simon Glass
       [not found] ` <1330737130-29600-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Simon Glass @ 2012-03-03  1:12 UTC (permalink / raw)
  To: Devicetree Discuss

There is a rather unfortunate bug in fdtget in that if multiple argument
sets are provided, it just repeats displaying the first set ones for
each set.

Fix this bug and add a test for it.

Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 fdtget.c                |    6 +++---
 tests/fdtget-runtest.sh |    2 +-
 tests/run_tests.sh      |    3 +++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/fdtget.c b/fdtget.c
index 2c384b6..9783e04 100644
--- a/fdtget.c
+++ b/fdtget.c
@@ -146,13 +146,13 @@ static int do_fdtget(struct display_info *disp, const char *filename,
 		return -1;
 
 	for (i = 0; i + 2 <= arg_count; i += 2) {
-		node = fdt_path_offset(blob, arg[0]);
+		node = fdt_path_offset(blob, arg[i]);
 		if (node < 0) {
-			report_error(arg[0], node);
+			report_error(arg[i], node);
 			return -1;
 		}
 
-		if (show_data_for_item(blob, disp, node, arg[1]))
+		if (show_data_for_item(blob, disp, node, arg[i + 1]))
 			return -1;
 	}
 	return 0;
diff --git a/tests/fdtget-runtest.sh b/tests/fdtget-runtest.sh
index dac7f9a..982fbe1 100755
--- a/tests/fdtget-runtest.sh
+++ b/tests/fdtget-runtest.sh
@@ -8,7 +8,7 @@ rm -f $LOG $EXPECT
 trap "rm -f $LOG $EXPECT" 0
 
 expect="$1"
-echo $expect >$EXPECT
+echo -e $expect >$EXPECT
 shift
 
 verbose_run_log_check "$LOG" $VALGRIND $DTGET "$@"
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index a561433..ac6fa17 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -475,6 +475,9 @@ fdtget_tests () {
     run_fdtget_test "61 62 63 0 12 34 0 0 0 a 0 0 0 b 0 0 0 c" \
 	-thhx $dtb /randomnode mixed
     run_wrap_error_test $DTGET -ts $dtb /randomnode doctor-who
+
+    # Test multiple arguments
+    run_fdtget_test "MyBoardName\nmemory" -ts $dtb / model /memory device_type
 }
 
 fdtput_tests () {
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/4] fdtget: Add -p to list the properties of a node
       [not found] ` <1330737130-29600-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2012-03-03  1:12   ` Simon Glass
       [not found]     ` <1330737130-29600-2-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2012-03-03  1:12   ` [PATCH 3/4] fdtget: Add -l to list the children " Simon Glass
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Simon Glass @ 2012-03-03  1:12 UTC (permalink / raw)
  To: Devicetree Discuss

This option lists the properties of each node given as a parameter, one
property per line.

Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 fdtget.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 60 insertions(+), 6 deletions(-)

diff --git a/fdtget.c b/fdtget.c
index 9783e04..874bcbf 100644
--- a/fdtget.c
+++ b/fdtget.c
@@ -1,6 +1,12 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
  *
+ * Portions from U-Boot cmd_fdt.c (C) Copyright 2007
+ * Gerald Van Baren, Custom IDEAS, vanbaren-He//nVnquyzQT0dZR+AlfA@public.gmane.org
+ * Based on code written by:
+ *   Pantelis Antoniou <pantelis.antoniou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> and
+ *   Matthew McClintock <msm-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of
@@ -17,6 +23,7 @@
  * MA 02111-1307 USA
  */
 
+#include <assert.h>
 #include <ctype.h>
 #include <getopt.h>
 #include <stdio.h>
@@ -27,10 +34,16 @@
 
 #include "util.h"
 
+enum display_mode {
+	MODE_SHOW_VALUE,	/* show values for node properties */
+	MODE_LIST_PROPS,	/* list the properties for a node */
+};
+
 /* Holds information which controls our output and options */
 struct display_info {
 	int type;		/* data type (s/i/u/x or 0 for default) */
 	int size;		/* data size (1/2/4) */
+	enum display_mode mode;	/* display mode that we are using */
 };
 
 static void report_error(const char *where, int err)
@@ -98,6 +111,32 @@ static int show_data(struct display_info *disp, const char *data, int len)
 }
 
 /**
+ * List all properties in a node, one per line.
+ *
+ * @param blob		FDT blob
+ * @param node		Node to display
+ * @return 0 if ok, or FDT_ERR... if not.
+ */
+static int list_properties(const void *blob, int node)
+{
+	const struct fdt_property *data;
+	const char *name;
+	int prop;
+
+	prop = fdt_first_property_offset(blob, node);
+	do {
+		/* Stop silently when there are no more properties */
+		if (prop < 0)
+			return prop == -FDT_ERR_NOTFOUND ? 0 : prop;
+		data = fdt_get_property_by_offset(blob, prop, NULL);
+		name = fdt_string(blob, fdt32_to_cpu(data->nameoff));
+		if (name)
+			puts(name);
+		prop = fdt_next_property_offset(blob, prop);
+	} while (1);
+}
+
+/**
  * Show the data for a given node (and perhaps property) according to the
  * display option provided.
  *
@@ -113,6 +152,10 @@ static int show_data_for_item(const void *blob, struct display_info *disp,
 	const void *value = NULL;
 	int len, err = 0;
 
+	if (disp->mode == MODE_LIST_PROPS)
+		return list_properties(blob, node);
+
+	assert(property);
 	value = fdt_getprop(blob, node, property, &len);
 	if (value) {
 		if (show_data(disp, value, len))
@@ -136,23 +179,25 @@ static int show_data_for_item(const void *blob, struct display_info *disp,
  * @param return 0 if ok, -ve on error
  */
 static int do_fdtget(struct display_info *disp, const char *filename,
-		     char **arg, int arg_count)
+		     char **arg, int arg_count, int args_per_step)
 {
 	char *blob;
+	const char *prop;
 	int i, node;
 
 	blob = utilfdt_read(filename);
 	if (!blob)
 		return -1;
 
-	for (i = 0; i + 2 <= arg_count; i += 2) {
+	for (i = 0; i + args_per_step <= arg_count; i += args_per_step) {
 		node = fdt_path_offset(blob, arg[i]);
 		if (node < 0) {
 			report_error(arg[i], node);
 			return -1;
 		}
+		prop = args_per_step == 1 ? NULL : arg[i + 1];
 
-		if (show_data_for_item(blob, disp, node, arg[i + 1]))
+		if (show_data_for_item(blob, disp, node, prop))
 			return -1;
 	}
 	return 0;
@@ -164,8 +209,10 @@ static const char *usage_msg =
 	"Each value is printed on a new line.\n\n"
 	"Usage:\n"
 	"	fdtget <options> <dt file> [<node> <property>]...\n"
+	"	fdtget -p <options> <dt file> [<node> ]...\n"
 	"Options:\n"
 	"\t-t <type>\tType of data\n"
+	"\t-p\t\tList properties for each node\n"
 	"\t-h\t\tPrint this help\n\n"
 	USAGE_TYPE_MSG;
 
@@ -182,12 +229,14 @@ int main(int argc, char *argv[])
 {
 	char *filename = NULL;
 	struct display_info disp;
+	int args_per_step = 2;
 
 	/* set defaults */
 	memset(&disp, '\0', sizeof(disp));
 	disp.size = -1;
+	disp.mode = MODE_SHOW_VALUE;
 	for (;;) {
-		int c = getopt(argc, argv, "ht:");
+		int c = getopt(argc, argv, "hpt:");
 		if (c == -1)
 			break;
 
@@ -201,6 +250,11 @@ int main(int argc, char *argv[])
 					&disp.size))
 				usage("Invalid type string");
 			break;
+
+		case 'p':
+			disp.mode = MODE_LIST_PROPS;
+			args_per_step = 1;
+			break;
 		}
 	}
 
@@ -217,10 +271,10 @@ int main(int argc, char *argv[])
 		return 0;
 
 	/* Check for node, property arguments */
-	if (argc % 2)
+	if (args_per_step == 2 && (argc % 2))
 		usage("Must have an even number of arguments");
 
-	if (do_fdtget(&disp, filename, argv, argc))
+	if (do_fdtget(&disp, filename, argv, argc, args_per_step))
 		return 1;
 	return 0;
 }
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/4] fdtget: Add -l to list the children of a node
       [not found] ` <1330737130-29600-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2012-03-03  1:12   ` [PATCH 2/4] fdtget: Add -p to list the properties of a node Simon Glass
@ 2012-03-03  1:12   ` Simon Glass
       [not found]     ` <1330737130-29600-3-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2012-03-03  1:12   ` [PATCH 4/4] fdtget: Add -d to provide a default value Simon Glass
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Simon Glass @ 2012-03-03  1:12 UTC (permalink / raw)
  To: Devicetree Discuss

This option lists the children of each node given as a parameter, one
child per line.

Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 fdtget.c |   96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 84 insertions(+), 12 deletions(-)

diff --git a/fdtget.c b/fdtget.c
index 874bcbf..9ed5edd 100644
--- a/fdtget.c
+++ b/fdtget.c
@@ -37,6 +37,7 @@
 enum display_mode {
 	MODE_SHOW_VALUE,	/* show values for node properties */
 	MODE_LIST_PROPS,	/* list the properties for a node */
+	MODE_LIST_CHILDREN,	/* list the children of a node */
 };
 
 /* Holds information which controls our output and options */
@@ -136,6 +137,61 @@ static int list_properties(const void *blob, int node)
 	} while (1);
 }
 
+#define MAX_LEVEL	32		/* how deeply nested we will go */
+
+/**
+ * List all children in a node, one per line
+ *
+ * @param blob		FDT blob
+ * @param node		Node to display
+ * @return 0 if ok, or FDT_ERR... if not.
+ */
+static int list_children(const void *blob, int node)
+{
+	int nextoffset;		/* next node offset from libfdt */
+	uint32_t tag;		/* current tag */
+	int level = 0;		/* keep track of nesting level */
+	const char *pathp;
+	int depth = 1;		/* the assumed depth of this node */
+
+	while (level >= 0) {
+		tag = fdt_next_tag(blob, node, &nextoffset);
+		switch (tag) {
+		case FDT_BEGIN_NODE:
+			pathp = fdt_get_name(blob, node, NULL);
+			if (level <= depth) {
+				if (pathp == NULL)
+					pathp = "/* NULL pointer error */";
+				if (*pathp == '\0')
+					pathp = "/";	/* root is nameless */
+				if (level == 1)
+					puts(pathp);
+			}
+			level++;
+			if (level >= MAX_LEVEL) {
+				printf("Nested too deep, aborting.\n");
+				return 1;
+			}
+			break;
+		case FDT_END_NODE:
+			level--;
+			if (level == 0)
+				level = -1;		/* exit the loop */
+			break;
+		case FDT_END:
+			return 1;
+		case FDT_PROP:
+			break;
+		default:
+			if (level <= depth)
+				printf("Unknown tag 0x%08X\n", tag);
+			return 1;
+		}
+		node = nextoffset;
+	}
+	return 0;
+}
+
 /**
  * Show the data for a given node (and perhaps property) according to the
  * display option provided.
@@ -152,20 +208,30 @@ static int show_data_for_item(const void *blob, struct display_info *disp,
 	const void *value = NULL;
 	int len, err = 0;
 
-	if (disp->mode == MODE_LIST_PROPS)
-		return list_properties(blob, node);
+	switch (disp->mode) {
+	case MODE_LIST_PROPS:
+		err = list_properties(blob, node);
+		break;
+
+	case MODE_LIST_CHILDREN:
+		err = list_children(blob, node);
+		break;
 
-	assert(property);
-	value = fdt_getprop(blob, node, property, &len);
-	if (value) {
-		if (show_data(disp, value, len))
+	default:
+		assert(property);
+		value = fdt_getprop(blob, node, property, &len);
+		if (value) {
+			if (show_data(disp, value, len))
+				err = -1;
+			else
+				printf("\n");
+		} else {
+			report_error(property, len);
 			err = -1;
-		else
-			printf("\n");
-	} else {
-		report_error(property, len);
-		err = -1;
+		}
+		break;
 	}
+
 	return err;
 }
 
@@ -213,6 +279,7 @@ static const char *usage_msg =
 	"Options:\n"
 	"\t-t <type>\tType of data\n"
 	"\t-p\t\tList properties for each node\n"
+	"\t-l\t\tList children for each node\n"
 	"\t-h\t\tPrint this help\n\n"
 	USAGE_TYPE_MSG;
 
@@ -236,7 +303,7 @@ int main(int argc, char *argv[])
 	disp.size = -1;
 	disp.mode = MODE_SHOW_VALUE;
 	for (;;) {
-		int c = getopt(argc, argv, "hpt:");
+		int c = getopt(argc, argv, "hlpt:");
 		if (c == -1)
 			break;
 
@@ -255,6 +322,11 @@ int main(int argc, char *argv[])
 			disp.mode = MODE_LIST_PROPS;
 			args_per_step = 1;
 			break;
+
+		case 'l':
+			disp.mode = MODE_LIST_CHILDREN;
+			args_per_step = 1;
+			break;
 		}
 	}
 
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/4] fdtget: Add -d to provide a default value
       [not found] ` <1330737130-29600-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2012-03-03  1:12   ` [PATCH 2/4] fdtget: Add -p to list the properties of a node Simon Glass
  2012-03-03  1:12   ` [PATCH 3/4] fdtget: Add -l to list the children " Simon Glass
@ 2012-03-03  1:12   ` Simon Glass
       [not found]     ` <1330737130-29600-4-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2012-03-06  2:21   ` [PATCH 1/4] fdtget: Fix multiple arg bug and add test for it David Gibson
  2012-03-07 19:27   ` Jon Loeliger
  4 siblings, 1 reply; 16+ messages in thread
From: Simon Glass @ 2012-03-03  1:12 UTC (permalink / raw)
  To: Devicetree Discuss

Sometimes the requested node or property is not present in the device
tree. This option provides a way of reporting a default value in this
case, rather than halting with an error.

Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 fdtget.c           |   20 +++++++++++++++++---
 tests/run_tests.sh |    6 ++++++
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/fdtget.c b/fdtget.c
index 9ed5edd..5e87545 100644
--- a/fdtget.c
+++ b/fdtget.c
@@ -45,6 +45,7 @@ struct display_info {
 	int type;		/* data type (s/i/u/x or 0 for default) */
 	int size;		/* data size (1/2/4) */
 	enum display_mode mode;	/* display mode that we are using */
+	const char *default_val; /* default value if node/property not found */
 };
 
 static void report_error(const char *where, int err)
@@ -225,6 +226,8 @@ static int show_data_for_item(const void *blob, struct display_info *disp,
 				err = -1;
 			else
 				printf("\n");
+		} else if (disp->default_val) {
+			puts(disp->default_val);
 		} else {
 			report_error(property, len);
 			err = -1;
@@ -258,8 +261,13 @@ static int do_fdtget(struct display_info *disp, const char *filename,
 	for (i = 0; i + args_per_step <= arg_count; i += args_per_step) {
 		node = fdt_path_offset(blob, arg[i]);
 		if (node < 0) {
-			report_error(arg[i], node);
-			return -1;
+			if (disp->default_val) {
+				puts(disp->default_val);
+				continue;
+			} else {
+				report_error(arg[i], node);
+				return -1;
+			}
 		}
 		prop = args_per_step == 1 ? NULL : arg[i + 1];
 
@@ -280,6 +288,8 @@ static const char *usage_msg =
 	"\t-t <type>\tType of data\n"
 	"\t-p\t\tList properties for each node\n"
 	"\t-l\t\tList children for each node\n"
+	"\t-d\t\tDefault value to display when the property is "
+			"missing\n"
 	"\t-h\t\tPrint this help\n\n"
 	USAGE_TYPE_MSG;
 
@@ -303,7 +313,7 @@ int main(int argc, char *argv[])
 	disp.size = -1;
 	disp.mode = MODE_SHOW_VALUE;
 	for (;;) {
-		int c = getopt(argc, argv, "hlpt:");
+		int c = getopt(argc, argv, "d:hlpt:");
 		if (c == -1)
 			break;
 
@@ -327,6 +337,10 @@ int main(int argc, char *argv[])
 			disp.mode = MODE_LIST_CHILDREN;
 			args_per_step = 1;
 			break;
+
+		case 'd':
+			disp.default_val = optarg;
+			break;
 		}
 	}
 
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index ac6fa17..deffae3 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -478,6 +478,12 @@ fdtget_tests () {
 
     # Test multiple arguments
     run_fdtget_test "MyBoardName\nmemory" -ts $dtb / model /memory device_type
+
+    # Test defaults
+    run_wrap_error_test $DTGET -tx $dtb /randomnode doctor-who
+    run_fdtget_test "<the dead silence>" -tx \
+	-d "<the dead silence>" $dtb /randomnode doctor-who
+    run_fdtget_test "<blink>" -tx -d "<blink>" $dtb /memory doctor-who
 }
 
 fdtput_tests () {
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/4] fdtget: Fix multiple arg bug and add test for it
       [not found] ` <1330737130-29600-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
                     ` (2 preceding siblings ...)
  2012-03-03  1:12   ` [PATCH 4/4] fdtget: Add -d to provide a default value Simon Glass
@ 2012-03-06  2:21   ` David Gibson
  2012-03-07 19:27   ` Jon Loeliger
  4 siblings, 0 replies; 16+ messages in thread
From: David Gibson @ 2012-03-06  2:21 UTC (permalink / raw)
  To: Simon Glass; +Cc: Devicetree Discuss

On Fri, Mar 02, 2012 at 05:12:07PM -0800, Simon Glass wrote:
> There is a rather unfortunate bug in fdtget in that if multiple argument
> sets are provided, it just repeats displaying the first set ones for
> each set.
> 
> Fix this bug and add a test for it.
> 
> Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Acked-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>

-- 
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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/4] fdtget: Add -p to list the properties of a node
       [not found]     ` <1330737130-29600-2-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2012-03-06  2:22       ` David Gibson
  2012-03-07 19:27       ` Jon Loeliger
  1 sibling, 0 replies; 16+ messages in thread
From: David Gibson @ 2012-03-06  2:22 UTC (permalink / raw)
  To: Simon Glass; +Cc: Devicetree Discuss

On Fri, Mar 02, 2012 at 05:12:08PM -0800, Simon Glass wrote:
> This option lists the properties of each node given as a parameter, one
> property per line.
> 
> Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Acked-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
-- 
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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/4] fdtget: Add -l to list the children of a node
       [not found]     ` <1330737130-29600-3-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2012-03-06  2:23       ` David Gibson
       [not found]         ` <20120306022323.GC12818-MK4v0fQdeXQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
  2012-03-07 19:27       ` Jon Loeliger
  1 sibling, 1 reply; 16+ messages in thread
From: David Gibson @ 2012-03-06  2:23 UTC (permalink / raw)
  To: Simon Glass; +Cc: Devicetree Discuss

On Fri, Mar 02, 2012 at 05:12:09PM -0800, Simon Glass wrote:
> This option lists the children of each node given as a parameter, one
> child per line.

In formal, user-visible contexts, like the usage message and
documentation, I prefer to use "subnodes" rather than "children".

-- 
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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/4] fdtget: Add -d to provide a default value
       [not found]     ` <1330737130-29600-4-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2012-03-06  2:23       ` David Gibson
  2012-03-07 19:28       ` Jon Loeliger
  1 sibling, 0 replies; 16+ messages in thread
From: David Gibson @ 2012-03-06  2:23 UTC (permalink / raw)
  To: Simon Glass; +Cc: Devicetree Discuss

On Fri, Mar 02, 2012 at 05:12:10PM -0800, Simon Glass wrote:
> Sometimes the requested node or property is not present in the device
> tree. This option provides a way of reporting a default value in this
> case, rather than halting with an error.
> 
> Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Acked-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
-- 
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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/4] fdtget: Add -l to list the children of a node
       [not found]         ` <20120306022323.GC12818-MK4v0fQdeXQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
@ 2012-03-07  0:37           ` Simon Glass
  0 siblings, 0 replies; 16+ messages in thread
From: Simon Glass @ 2012-03-07  0:37 UTC (permalink / raw)
  To: David Gibson; +Cc: Devicetree Discuss

Hi David,

On Mon, Mar 5, 2012 at 6:23 PM, David Gibson
<david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
> On Fri, Mar 02, 2012 at 05:12:09PM -0800, Simon Glass wrote:
>> This option lists the children of each node given as a parameter, one
>> child per line.
>
> In formal, user-visible contexts, like the usage message and
> documentation, I prefer to use "subnodes" rather than "children".

Yes I should have done that, will re-submit this and the next patch
which would otherwise have a minor conflict.

Regards,
Simon

>
> --
> 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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/4] fdtget: Fix multiple arg bug and add test for it
       [not found] ` <1330737130-29600-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
                     ` (3 preceding siblings ...)
  2012-03-06  2:21   ` [PATCH 1/4] fdtget: Fix multiple arg bug and add test for it David Gibson
@ 2012-03-07 19:27   ` Jon Loeliger
  4 siblings, 0 replies; 16+ messages in thread
From: Jon Loeliger @ 2012-03-07 19:27 UTC (permalink / raw)
  To: Simon Glass; +Cc: Devicetree Discuss

> There is a rather unfortunate bug in fdtget in that if multiple argument
> sets are provided, it just repeats displaying the first set ones for
> each set.
> 
> Fix this bug and add a test for it.
> 
> Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

Applied.

Thanks,
jdl

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/4] fdtget: Add -l to list the children of a node
       [not found]     ` <1330737130-29600-3-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2012-03-06  2:23       ` David Gibson
@ 2012-03-07 19:27       ` Jon Loeliger
  1 sibling, 0 replies; 16+ messages in thread
From: Jon Loeliger @ 2012-03-07 19:27 UTC (permalink / raw)
  To: Simon Glass; +Cc: Devicetree Discuss

> This option lists the children of each node given as a parameter, one
> child per line.
> 
> Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

I'll wait for the respin here.

jdl

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/4] fdtget: Add -p to list the properties of a node
       [not found]     ` <1330737130-29600-2-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2012-03-06  2:22       ` David Gibson
@ 2012-03-07 19:27       ` Jon Loeliger
       [not found]         ` <E1S5MWl-000880-59-CYoMK+44s/E@public.gmane.org>
  1 sibling, 1 reply; 16+ messages in thread
From: Jon Loeliger @ 2012-03-07 19:27 UTC (permalink / raw)
  To: Simon Glass; +Cc: Devicetree Discuss

> This option lists the properties of each node given as a parameter, one
> property per line.
> 
> Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

Applied.

Thanks,
jdl

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/4] fdtget: Add -d to provide a default value
       [not found]     ` <1330737130-29600-4-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2012-03-06  2:23       ` David Gibson
@ 2012-03-07 19:28       ` Jon Loeliger
  1 sibling, 0 replies; 16+ messages in thread
From: Jon Loeliger @ 2012-03-07 19:28 UTC (permalink / raw)
  To: Simon Glass; +Cc: Devicetree Discuss

> Sometimes the requested node or property is not present in the device
> tree. This option provides a way of reporting a default value in this
> case, rather than halting with an error.
> 
> Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

I'll wait for the respin here too.

jdl

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/4] fdtget: Add -p to list the properties of a node
       [not found]         ` <E1S5MWl-000880-59-CYoMK+44s/E@public.gmane.org>
@ 2012-03-07 23:38           ` David Gibson
       [not found]             ` <20120307233853.GN1929-MK4v0fQdeXQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: David Gibson @ 2012-03-07 23:38 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: Devicetree Discuss

On Wed, Mar 07, 2012 at 01:27:59PM -0600, Jon Loeliger wrote:
> > This option lists the properties of each node given as a parameter, one
> > property per line.
> > 
> > Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> 
> Applied.

But not pushed out by the looks of it?

-- 
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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/4] fdtget: Add -p to list the properties of a node
       [not found]             ` <20120307233853.GN1929-MK4v0fQdeXQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
@ 2012-03-08  1:25               ` Jon Loeliger
       [not found]                 ` <E1S5S6J-0001jL-27-CYoMK+44s/E@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Jon Loeliger @ 2012-03-08  1:25 UTC (permalink / raw)
  To: David Gibson; +Cc: Devicetree Discuss

> On Wed, Mar 07, 2012 at 01:27:59PM -0600, Jon Loeliger wrote:
> > > This option lists the properties of each node given as a parameter, one
> > > property per line.
> > > 
> > > Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> > 
> > Applied.
> 
> But not pushed out by the looks of it?

I thought it was....

$ git log --oneline | head -6
7fcbef2 fdtget: Add -d to provide a default value
16c99ee fdtget: Add -l to list the subnodes of a node
30eb201 fdtget: Add -p to list the properties of a node
097ec97 fdtget: Fix multiple arg bug and add test for it
a6e6c60 dtc: Fix zero-length input segfault
e280442 Fix uninitialized access bug in utilfdt_decode_type

jdl

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/4] fdtget: Add -p to list the properties of a node
       [not found]                 ` <E1S5S6J-0001jL-27-CYoMK+44s/E@public.gmane.org>
@ 2012-03-08  1:31                   ` David Gibson
  0 siblings, 0 replies; 16+ messages in thread
From: David Gibson @ 2012-03-08  1:31 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: Devicetree Discuss

On Wed, Mar 07, 2012 at 07:25:03PM -0600, Jon Loeliger wrote:
> > On Wed, Mar 07, 2012 at 01:27:59PM -0600, Jon Loeliger wrote:
> > > > This option lists the properties of each node given as a parameter, one
> > > > property per line.
> > > > 
> > > > Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> > > 
> > > Applied.
> > 
> > But not pushed out by the looks of it?
> 
> I thought it was....
> 
> $ git log --oneline | head -6
> 7fcbef2 fdtget: Add -d to provide a default value
> 16c99ee fdtget: Add -l to list the subnodes of a node
> 30eb201 fdtget: Add -p to list the properties of a node
> 097ec97 fdtget: Fix multiple arg bug and add test for it
> a6e6c60 dtc: Fix zero-length input segfault
> e280442 Fix uninitialized access bug in utilfdt_decode_type

Duh, sorry.  Forgetting the differences between fetches and pulls.

-- 
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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-03-08  1:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-03  1:12 [PATCH 1/4] fdtget: Fix multiple arg bug and add test for it Simon Glass
     [not found] ` <1330737130-29600-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-03-03  1:12   ` [PATCH 2/4] fdtget: Add -p to list the properties of a node Simon Glass
     [not found]     ` <1330737130-29600-2-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-03-06  2:22       ` David Gibson
2012-03-07 19:27       ` Jon Loeliger
     [not found]         ` <E1S5MWl-000880-59-CYoMK+44s/E@public.gmane.org>
2012-03-07 23:38           ` David Gibson
     [not found]             ` <20120307233853.GN1929-MK4v0fQdeXQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2012-03-08  1:25               ` Jon Loeliger
     [not found]                 ` <E1S5S6J-0001jL-27-CYoMK+44s/E@public.gmane.org>
2012-03-08  1:31                   ` David Gibson
2012-03-03  1:12   ` [PATCH 3/4] fdtget: Add -l to list the children " Simon Glass
     [not found]     ` <1330737130-29600-3-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-03-06  2:23       ` David Gibson
     [not found]         ` <20120306022323.GC12818-MK4v0fQdeXQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2012-03-07  0:37           ` Simon Glass
2012-03-07 19:27       ` Jon Loeliger
2012-03-03  1:12   ` [PATCH 4/4] fdtget: Add -d to provide a default value Simon Glass
     [not found]     ` <1330737130-29600-4-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-03-06  2:23       ` David Gibson
2012-03-07 19:28       ` Jon Loeliger
2012-03-06  2:21   ` [PATCH 1/4] fdtget: Fix multiple arg bug and add test for it David Gibson
2012-03-07 19:27   ` Jon Loeliger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.