mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-30 07:01:32 +01:00
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:
parent
ccc3da77ae
commit
abf0c80292
@ -592,13 +592,7 @@ class DtbPlatdata():
|
|||||||
self.out(';\n')
|
self.out(';\n')
|
||||||
self.out('};\n')
|
self.out('};\n')
|
||||||
|
|
||||||
def output_node(self, node):
|
def _output_list(self, node, prop):
|
||||||
"""Output the C code for a node
|
|
||||||
|
|
||||||
Args:
|
|
||||||
node (fdt.Node): node to output
|
|
||||||
"""
|
|
||||||
def _output_list(node, prop):
|
|
||||||
"""Output the C code for a devicetree property that holds a list
|
"""Output the C code for a devicetree property that holds a list
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -637,6 +631,12 @@ class DtbPlatdata():
|
|||||||
self.buf(', '.join(vals[i:i + 8]))
|
self.buf(', '.join(vals[i:i + 8]))
|
||||||
self.buf('}')
|
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)
|
struct_name, _ = self.get_normalized_compat_name(node)
|
||||||
var_name = conv_name_to_c(node.name)
|
var_name = conv_name_to_c(node.name)
|
||||||
self.buf('/* Node %s index %d */\n' % (node.path, node.idx))
|
self.buf('/* Node %s index %d */\n' % (node.path, node.idx))
|
||||||
@ -651,7 +651,7 @@ class DtbPlatdata():
|
|||||||
|
|
||||||
# Special handling for lists
|
# Special handling for lists
|
||||||
if isinstance(prop.value, list):
|
if isinstance(prop.value, list):
|
||||||
_output_list(node, prop)
|
self._output_list(node, prop)
|
||||||
else:
|
else:
|
||||||
self.buf(get_value(prop.type, prop.value))
|
self.buf(get_value(prop.type, prop.value))
|
||||||
self.buf(',\n')
|
self.buf(',\n')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user