summaryrefslogtreecommitdiff
path: root/tools/dtoc
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-07-22 09:22:49 -0600
committerTom Rini <trini@konsulko.com>2016-07-25 12:05:55 -0400
commitd6a33918fb50fe2f3917b400cb84220b1d7e4392 (patch)
tree2d2f6ab49b02292d4eb26da7cb31b56979529ac8 /tools/dtoc
parentc55d02b2aca9b477dcf4c81062cc8e301d8c89d8 (diff)
downloadu-boot-imx-d6a33918fb50fe2f3917b400cb84220b1d7e4392.zip
u-boot-imx-d6a33918fb50fe2f3917b400cb84220b1d7e4392.tar.gz
u-boot-imx-d6a33918fb50fe2f3917b400cb84220b1d7e4392.tar.bz2
dtoc: Correct the type widening code in fdt_fallback
This code does not match the fdt version in fdt.py. When dtoc is unable to use the Python libfdt library, it uses the fallback version, which does not widen arrays correctly. Fix this to avoid a warning 'excess elements in array initialize' in dt-platdata.c which happens on some platforms. Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/dtoc')
-rw-r--r--tools/dtoc/fdt_fallback.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/dtoc/fdt_fallback.py b/tools/dtoc/fdt_fallback.py
index 14decf3..9ed11e4 100644
--- a/tools/dtoc/fdt_fallback.py
+++ b/tools/dtoc/fdt_fallback.py
@@ -71,6 +71,12 @@ class Prop:
if type(newprop.value) == list and type(self.value) != list:
self.value = newprop.value
+ if type(self.value) == list and len(newprop.value) > len(self.value):
+ val = fdt_util.GetEmpty(self.type)
+ while len(self.value) < len(newprop.value):
+ self.value.append(val)
+
+
class Node:
"""A device tree node