summaryrefslogtreecommitdiff
path: root/tools/dtoc/fdt.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-05-18 07:00:33 +0300
committerSimon Glass <sjg@chromium.org>2019-07-11 01:52:58 +0300
commit194b8d5e71a41dbb839fdaa49677b146e6a0fb5d (patch)
tree57a0387ce8d1b8be0bc5757acda6b6e9c0c2482d /tools/dtoc/fdt.py
parent1953ce75312ab50988f2c81f7250c99dfc2ed52b (diff)
downloadu-boot-194b8d5e71a41dbb839fdaa49677b146e6a0fb5d.tar.xz
dtoc: Use GetBytes() to obtain repeating bytes
Use this helper function which works on both Python 2 and Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/fdt.py')
-rw-r--r--tools/dtoc/fdt.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index 031b3a0084..9518a287a2 100644
--- a/tools/dtoc/fdt.py
+++ b/tools/dtoc/fdt.py
@@ -11,6 +11,7 @@ import sys
import fdt_util
import libfdt
from libfdt import QUIET_NOTFOUND
+import tools
# This deals with a device tree, presenting it as an assortment of Node and
# Prop objects, representing nodes and properties, respectively. This file
@@ -334,7 +335,8 @@ class Node:
Args:
prop_name: Name of property
"""
- self.props[prop_name] = Prop(self, None, prop_name, '\0' * 4)
+ self.props[prop_name] = Prop(self, None, prop_name,
+ tools.GetBytes(0, 4))
def AddEmptyProp(self, prop_name, len):
"""Add a property with a fixed data size, for filling in later
@@ -346,7 +348,7 @@ class Node:
prop_name: Name of property
len: Length of data in property
"""
- value = chr(0) * len
+ value = tools.GetBytes(0, len)
self.props[prop_name] = Prop(self, None, prop_name, value)
def SetInt(self, prop_name, val):