summaryrefslogtreecommitdiff
path: root/scripts/dtc
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-07-06 10:27:21 -0600
committerSimon Glass <sjg@chromium.org>2018-07-09 09:11:00 -0600
commita1e0085519b7b34b2db36faa76e13b7f1717f570 (patch)
tree942fcd581f6c29c84860200029d8cd479a50533c /scripts/dtc
parent3def0cf238e0df9736a4ce8fb54c1eb561a56ddd (diff)
downloadu-boot-a1e0085519b7b34b2db36faa76e13b7f1717f570.tar.gz
libfdt: Fix the Python pack() function
This currently fails to reduce the device-tree bytearray size. Fix this. This stands in for a pending upstream change. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'scripts/dtc')
-rw-r--r--scripts/dtc/pylibfdt/libfdt.i_shipped6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped
index 6774b93b2c..5b38e63b26 100644
--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
+++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
@@ -442,7 +442,11 @@ class Fdt:
Raises:
FdtException if any error occurs
"""
- return check_err(fdt_pack(self._fdt), quiet)
+ err = check_err(fdt_pack(self._fdt), quiet)
+ if err:
+ return err
+ del self._fdt[self.totalsize():]
+ return err
def getprop(self, nodeoffset, prop_name, quiet=()):
"""Get a property from a node