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>
This commit is contained in:
Simon Glass 2016-07-22 09:22:49 -06:00 committed by Tom Rini
parent c55d02b2ac
commit d6a33918fb
1 changed files with 6 additions and 0 deletions

View File

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