Skip to content
Snippets Groups Projects
Commit 35d50370 authored by Simon Glass's avatar Simon Glass
Browse files

dtoc: Put each phandle on a separate line


When writing values from properties which contain phandles, dtoc currently
writes 8 phandles per line. Change this to write one phandle per line.
This helps reduce line length, since phandles are generally longer and may
have arguments.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Tested-by: default avatarKever Yang <kever.yang@rock-chips.com>
parent 0d15463c
No related branches found
No related tags found
No related merge requests found
...@@ -468,15 +468,17 @@ class DtbPlatdata(object): ...@@ -468,15 +468,17 @@ class DtbPlatdata(object):
target_node = self._fdt.phandle_to_node[phandle] target_node = self._fdt.phandle_to_node[phandle]
name = conv_name_to_c(target_node.name) name = conv_name_to_c(target_node.name)
vals.append('{&%s%s, %d}' % (VAL_PREFIX, name, id_num)) vals.append('{&%s%s, %d}' % (VAL_PREFIX, name, id_num))
for val in vals:
self.buf('\n\t\t%s,' % val)
else: else:
for val in prop.value: for val in prop.value:
vals.append(get_value(prop.type, val)) vals.append(get_value(prop.type, val))
# Put 8 values per line to avoid very long lines. # Put 8 values per line to avoid very long lines.
for i in xrange(0, len(vals), 8): for i in xrange(0, len(vals), 8):
if i: if i:
self.buf(',\n\t\t') self.buf(',\n\t\t')
self.buf(', '.join(vals[i:i + 8])) self.buf(', '.join(vals[i:i + 8]))
self.buf('}') self.buf('}')
else: else:
self.buf(get_value(prop.type, prop.value)) self.buf(get_value(prop.type, prop.value))
......
...@@ -252,7 +252,8 @@ U_BOOT_DEVICE(phandle_target) = { ...@@ -252,7 +252,8 @@ U_BOOT_DEVICE(phandle_target) = {
}; };
static struct dtd_source dtv_phandle_source = { static struct dtd_source dtv_phandle_source = {
\t.clocks\t\t\t= {{&dtv_phandle_target, 1}}, \t.clocks\t\t\t= {
\t\t{&dtv_phandle_target, 1},},
}; };
U_BOOT_DEVICE(phandle_source) = { U_BOOT_DEVICE(phandle_source) = {
\t.name\t\t= "source", \t.name\t\t= "source",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment