dtoc: Make _output_list a top-level function

It is annoying to have this function inside its parent since it makes the
parent longer and hard to read. Move it to the top level.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2020-12-23 08:11:20 -07:00
parent ccc3da77ae
commit abf0c80292

View File

@ -592,13 +592,7 @@ class DtbPlatdata():
self.out(';\n')
self.out('};\n')
def output_node(self, node):
"""Output the C code for a node
Args:
node (fdt.Node): node to output
"""
def _output_list(node, prop):
def _output_list(self, node, prop):
"""Output the C code for a devicetree property that holds a list
Args:
@ -637,6 +631,12 @@ class DtbPlatdata():
self.buf(', '.join(vals[i:i + 8]))
self.buf('}')
def output_node(self, node):
"""Output the C code for a node
Args:
node (fdt.Node): node to output
"""
struct_name, _ = self.get_normalized_compat_name(node)
var_name = conv_name_to_c(node.name)
self.buf('/* Node %s index %d */\n' % (node.path, node.idx))
@ -651,7 +651,7 @@ class DtbPlatdata():
# Special handling for lists
if isinstance(prop.value, list):
_output_list(node, prop)
self._output_list(node, prop)
else:
self.buf(get_value(prop.type, prop.value))
self.buf(',\n')