summaryrefslogtreecommitdiff
path: root/tools/dtoc
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-29 14:15:56 -0600
committerSimon Glass <sjg@chromium.org>2017-09-15 05:27:47 -0600
commit0d15463c0537806f70ea2359e32e4deb8c4766c2 (patch)
tree1179616d8c60355db39515d34d23bc62fe9eb50c /tools/dtoc
parent8fed2eb20c2ef95d69f9683ab07f0ea869616713 (diff)
downloadu-boot-0d15463c0537806f70ea2359e32e4deb8c4766c2.tar.gz
dtoc: Rename the phandle struct
Rather than naming the phandle struct according to the number of cells it uses (e.g. struct phandle_2_cell) name it according to the number of arguments it has (e.g. struct phandle_1_arg). This is a more intuitive naming. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'tools/dtoc')
-rw-r--r--tools/dtoc/dtb_platdata.py3
-rw-r--r--tools/dtoc/test_dtoc.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index 001bc4ea66..0234f71b76 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -419,7 +419,8 @@ class DtbPlatdata(object):
info = self.get_phandle_argc(prop, structs[name])
if info:
# For phandles, include a reference to the target
- self.out('\t%s%s[%d]' % (tab_to(2, 'struct phandle_2_cell'),
+ struct_name = 'struct phandle_%d_arg' % info.max_args
+ self.out('\t%s%s[%d]' % (tab_to(2, struct_name),
conv_name_to_c(prop.name),
len(prop.value) / 2))
else:
diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
index 62460acb7c..23c4439ed9 100644
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -228,7 +228,7 @@ U_BOOT_DEVICE(pmic_at_9) = {
self.assertEqual('''#include <stdbool.h>
#include <libfdt.h>
struct dtd_source {
-\tstruct phandle_2_cell clocks[1];
+\tstruct phandle_1_arg clocks[1];
};
struct dtd_target {
\tfdt32_t\t\tintval;