Commit 0d15463c0537806f70ea2359e32e4deb8c4766c2
1 parent
8fed2eb20c
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
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>
Showing 6 changed files with 13 additions and 7 deletions Side-by-side Diff
doc/driver-model/of-plat.txt
drivers/clk/clk-uclass.c
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | #if CONFIG_IS_ENABLED(OF_CONTROL) |
24 | 24 | # if CONFIG_IS_ENABLED(OF_PLATDATA) |
25 | 25 | int clk_get_by_index_platdata(struct udevice *dev, int index, |
26 | - struct phandle_2_cell *cells, struct clk *clk) | |
26 | + struct phandle_1_arg *cells, struct clk *clk) | |
27 | 27 | { |
28 | 28 | int ret; |
29 | 29 |
include/clk.h
... | ... | @@ -61,9 +61,9 @@ |
61 | 61 | }; |
62 | 62 | |
63 | 63 | #if CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(CLK) |
64 | -struct phandle_2_cell; | |
64 | +struct phandle_1_arg; | |
65 | 65 | int clk_get_by_index_platdata(struct udevice *dev, int index, |
66 | - struct phandle_2_cell *cells, struct clk *clk); | |
66 | + struct phandle_1_arg *cells, struct clk *clk); | |
67 | 67 | |
68 | 68 | /** |
69 | 69 | * clock_get_by_index - Get/request a clock by integer index. |
include/dt-structs.h
... | ... | @@ -9,7 +9,12 @@ |
9 | 9 | |
10 | 10 | /* These structures may only be used in SPL */ |
11 | 11 | #if CONFIG_IS_ENABLED(OF_PLATDATA) |
12 | -struct phandle_2_cell { | |
12 | +struct phandle_0_arg { | |
13 | + const void *node; | |
14 | + int id[0]; | |
15 | +}; | |
16 | + | |
17 | +struct phandle_1_arg { | |
13 | 18 | const void *node; |
14 | 19 | int id; |
15 | 20 | }; |
tools/dtoc/dtb_platdata.py
... | ... | @@ -419,7 +419,8 @@ |
419 | 419 | info = self.get_phandle_argc(prop, structs[name]) |
420 | 420 | if info: |
421 | 421 | # For phandles, include a reference to the target |
422 | - self.out('\t%s%s[%d]' % (tab_to(2, 'struct phandle_2_cell'), | |
422 | + struct_name = 'struct phandle_%d_arg' % info.max_args | |
423 | + self.out('\t%s%s[%d]' % (tab_to(2, struct_name), | |
423 | 424 | conv_name_to_c(prop.name), |
424 | 425 | len(prop.value) / 2)) |
425 | 426 | else: |
tools/dtoc/test_dtoc.py