summaryrefslogtreecommitdiff
path: root/fdtget.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-03-02 17:12:07 -0800
committerJon Loeliger <jdl@jdl.com>2012-03-07 13:25:03 -0600
commit097ec97c1a35685957210adb93692c3e210bc82c (patch)
tree5331cc1eb4e0706816ef87e67df38786848d6d0b /fdtget.c
parenta6e6c60e3a97a6b3a033cd052bb3740fd53cbf4c (diff)
downloaddevice-tree-compiler-097ec97c1a35685957210adb93692c3e210bc82c.tar.gz
fdtget: Fix multiple arg bug and add test for it
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@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'fdtget.c')
-rw-r--r--fdtget.c6
1 files changed, 3 insertions, 3 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;