[U-Boot] [PATCH 18/19] binman: Rename fdt variable to dtb

Simon Glass sjg at chromium.org
Mon Apr 17 02:22:32 UTC 2017


Since fdt is the name of a module, use a different name for variables to
avoid a conflict.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 tools/binman/control.py                     | 10 +++++-----
 tools/binman/etype/u_boot_dtb_with_ucode.py |  9 ++++-----
 tools/binman/func_test.py                   |  4 ++--
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/tools/binman/control.py b/tools/binman/control.py
index e90967807c..42d75efbcd 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -40,15 +40,15 @@ def _ReadImageDesc(binman_node):
         images['image'] = Image('image', binman_node)
     return images
 
-def _FindBinmanNode(fdt):
+def _FindBinmanNode(dtb):
     """Find the 'binman' node in the device tree
 
     Args:
-        fdt: Fdt object to scan
+        dtb: Fdt object to scan
     Returns:
         Node object of /binman node, or None if not found
     """
-    for node in fdt.GetRoot().subnodes:
+    for node in dtb.GetRoot().subnodes:
         if node.name == 'binman':
             return node
     return None
@@ -92,8 +92,8 @@ def Binman(options, args):
         try:
             tools.SetInputDirs(options.indir)
             tools.PrepareOutputDir(options.outdir, options.preserve)
-            fdt = fdt_select.FdtScan(dtb_fname)
-            node = _FindBinmanNode(fdt)
+            dtb = fdt.FdtScan(dtb_fname)
+            node = _FindBinmanNode(dtb)
             if not node:
                 raise ValueError("Device tree '%s' does not have a 'binman' "
                                  "node" % dtb_fname)
diff --git a/tools/binman/etype/u_boot_dtb_with_ucode.py b/tools/binman/etype/u_boot_dtb_with_ucode.py
index 95405c6473..01ee36fb0d 100644
--- a/tools/binman/etype/u_boot_dtb_with_ucode.py
+++ b/tools/binman/etype/u_boot_dtb_with_ucode.py
@@ -44,9 +44,8 @@ class Entry_u_boot_dtb_with_ucode(Entry_blob):
             fd.write(self.data)
 
         # Remove the microcode
-        fdt = fdt_select.FdtScan(fname)
-        fdt.Scan()
-        ucode = fdt.GetNode('/microcode')
+        dtb = fdt.FdtScan(fname)
+        ucode = dtb.GetNode('/microcode')
         if not ucode:
             raise self.Raise("No /microcode node found in '%s'" % fname)
 
@@ -64,8 +63,8 @@ class Entry_u_boot_dtb_with_ucode(Entry_blob):
                     self.ucode_offset = data_prop.GetOffset() + 12
                     self.ucode_size = len(data_prop.bytes)
         if self.collate:
-            fdt.Pack()
-            fdt.Flush()
+            dtb.Pack()
+            dtb.Flush()
 
             # Make this file the contents of this entry
             self._pathname = fname
diff --git a/tools/binman/func_test.py b/tools/binman/func_test.py
index 7328d03b5c..8960e23f2c 100644
--- a/tools/binman/func_test.py
+++ b/tools/binman/func_test.py
@@ -658,8 +658,8 @@ class TestFunctional(unittest.TestCase):
         fname = tools.GetOutputFilename('test.dtb')
         with open(fname, 'wb') as fd:
             fd.write(second)
-        fdt = fdt_select.FdtScan(fname)
-        ucode = fdt.GetNode('/microcode')
+        dtb = fdt.FdtScan(fname)
+        ucode = dtb.GetNode('/microcode')
         self.assertTrue(ucode)
         for node in ucode.subnodes:
             self.assertFalse(node.props.get('data'))
-- 
2.12.2.762.g0e3151a226-goog



More information about the U-Boot mailing list