summaryrefslogtreecommitdiff
path: root/tools/dtoc/fdt.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-05-17 22:00:37 -0600
committerSimon Glass <sjg@chromium.org>2019-07-10 16:52:58 -0600
commit928527f6863a7176279f33e2e466b0d0f2d841d0 (patch)
tree3f0ea17e02ef6f0edf8286dc881f4af787ff9126 /tools/dtoc/fdt.py
parentf6b64815dda947090f112bd4f7e0e430a16b48d7 (diff)
downloadu-boot-928527f6863a7176279f33e2e466b0d0f2d841d0.tar.gz
dtoc: Convert the Fdt.Prop class to Python 3
Update this class to work correctly on Python 3 and to pass its unit tests. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/fdt.py')
-rw-r--r--tools/dtoc/fdt.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index 956e0c9800..2b2470c314 100644
--- a/tools/dtoc/fdt.py
+++ b/tools/dtoc/fdt.py
@@ -98,18 +98,18 @@ class Prop:
bytes
type: Value type
"""
- def __init__(self, node, offset, name, bytes):
+ def __init__(self, node, offset, name, data):
self._node = node
self._offset = offset
self.name = name
self.value = None
- self.bytes = str(bytes)
+ self.bytes = bytes(data)
self.dirty = False
- if not bytes:
+ if not data:
self.type = TYPE_BOOL
self.value = True
return
- self.type, self.value = BytesToValue(bytes)
+ self.type, self.value = BytesToValue(bytes(data))
def RefreshOffset(self, poffset):
self._offset = poffset