dtoc: Move BytesToValue() and GetEmpty() into PropBase
These functions are currently in a separate fdt_util file. Since they are
only used from PropBase and subclasses, it makes sense for them to be in the
PropBase class.
Move these functions into fdt.py along with the list of types.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/dtoc/fdt_normal.py b/tools/dtoc/fdt_normal.py
index ca5335b..c7c86b8 100644
--- a/tools/dtoc/fdt_normal.py
+++ b/tools/dtoc/fdt_normal.py
@@ -33,10 +33,10 @@
PropBase.__init__(self, node, offset, name)
self.bytes = bytes
if not bytes:
- self.type = fdt_util.TYPE_BOOL
+ self.type = fdt.TYPE_BOOL
self.value = True
return
- self.type, self.value = fdt_util.BytesToValue(bytes)
+ self.type, self.value = self.BytesToValue(bytes)
def GetPhandle(self):
"""Get a (single) phandle value from a property
@@ -75,7 +75,7 @@
self.value = [self.value]
if type(self.value) == list and len(newprop.value) > len(self.value):
- val = fdt_util.GetEmpty(self.type)
+ val = self.GetEmpty(self.type)
while len(self.value) < len(newprop.value):
self.value.append(val)