1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 09:12:08 +02:00

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>
This commit is contained in:
Simon Glass
2016-07-25 18:59:05 -06:00
parent a06a34b203
commit bc1dea3656
5 changed files with 80 additions and 79 deletions

View File

@@ -33,10 +33,10 @@ class Prop(PropBase):
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 @@ class Prop(PropBase):
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)