From 0d15463c0537806f70ea2359e32e4deb8c4766c2 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 29 Aug 2017 14:15:56 -0600 Subject: 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 Tested-by: Kever Yang --- tools/dtoc/dtb_platdata.py | 3 ++- tools/dtoc/test_dtoc.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'tools/dtoc') diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index 001bc4ea668..0234f71b767 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 62460acb7c5..23c4439ed91 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 #include struct dtd_source { -\tstruct phandle_2_cell clocks[1]; +\tstruct phandle_1_arg clocks[1]; }; struct dtd_target { \tfdt32_t\t\tintval; -- cgit v1.2.3