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>
This commit is contained in:
		
							parent
							
								
									8fed2eb20c
								
							
						
					
					
						commit
						0d15463c05
					
				|  | @ -111,7 +111,7 @@ struct dtd_rockchip_rk3288_dw_mshc { | ||||||
|         bool            cap_sd_highspeed; |         bool            cap_sd_highspeed; | ||||||
|         fdt32_t         card_detect_delay; |         fdt32_t         card_detect_delay; | ||||||
|         fdt32_t         clock_freq_min_max[2]; |         fdt32_t         clock_freq_min_max[2]; | ||||||
|         struct phandle_2_cell clocks[4]; |         struct phandle_1_arg clocks[4]; | ||||||
|         bool            disable_wp; |         bool            disable_wp; | ||||||
|         fdt32_t         fifo_depth; |         fdt32_t         fifo_depth; | ||||||
|         fdt32_t         interrupts[3]; |         fdt32_t         interrupts[3]; | ||||||
|  |  | ||||||
|  | @ -23,7 +23,7 @@ static inline struct clk_ops *clk_dev_ops(struct udevice *dev) | ||||||
| #if CONFIG_IS_ENABLED(OF_CONTROL) | #if CONFIG_IS_ENABLED(OF_CONTROL) | ||||||
| # if CONFIG_IS_ENABLED(OF_PLATDATA) | # if CONFIG_IS_ENABLED(OF_PLATDATA) | ||||||
| int clk_get_by_index_platdata(struct udevice *dev, int index, | int clk_get_by_index_platdata(struct udevice *dev, int index, | ||||||
| 			      struct phandle_2_cell *cells, struct clk *clk) | 			      struct phandle_1_arg *cells, struct clk *clk) | ||||||
| { | { | ||||||
| 	int ret; | 	int ret; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -61,9 +61,9 @@ struct clk { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #if CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(CLK) | #if CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(CLK) | ||||||
| struct phandle_2_cell; | struct phandle_1_arg; | ||||||
| int clk_get_by_index_platdata(struct udevice *dev, int index, | int clk_get_by_index_platdata(struct udevice *dev, int index, | ||||||
| 			      struct phandle_2_cell *cells, struct clk *clk); | 			      struct phandle_1_arg *cells, struct clk *clk); | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  * clock_get_by_index - Get/request a clock by integer index. |  * clock_get_by_index - Get/request a clock by integer index. | ||||||
|  |  | ||||||
|  | @ -9,7 +9,12 @@ | ||||||
| 
 | 
 | ||||||
| /* These structures may only be used in SPL */ | /* These structures may only be used in SPL */ | ||||||
| #if CONFIG_IS_ENABLED(OF_PLATDATA) | #if CONFIG_IS_ENABLED(OF_PLATDATA) | ||||||
| struct phandle_2_cell { | struct phandle_0_arg { | ||||||
|  | 	const void *node; | ||||||
|  | 	int id[0]; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | struct phandle_1_arg { | ||||||
| 	const void *node; | 	const void *node; | ||||||
| 	int id; | 	int id; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -419,7 +419,8 @@ class DtbPlatdata(object): | ||||||
|                 info = self.get_phandle_argc(prop, structs[name]) |                 info = self.get_phandle_argc(prop, structs[name]) | ||||||
|                 if info: |                 if info: | ||||||
|                     # For phandles, include a reference to the target |                     # 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), |                                              conv_name_to_c(prop.name), | ||||||
|                                              len(prop.value) / 2)) |                                              len(prop.value) / 2)) | ||||||
|                 else: |                 else: | ||||||
|  |  | ||||||
|  | @ -228,7 +228,7 @@ U_BOOT_DEVICE(pmic_at_9) = { | ||||||
|         self.assertEqual('''#include <stdbool.h> |         self.assertEqual('''#include <stdbool.h> | ||||||
| #include <libfdt.h> | #include <libfdt.h> | ||||||
| struct dtd_source { | struct dtd_source { | ||||||
| \tstruct phandle_2_cell clocks[1]; | \tstruct phandle_1_arg clocks[1]; | ||||||
| }; | }; | ||||||
| struct dtd_target { | struct dtd_target { | ||||||
| \tfdt32_t\t\tintval; | \tfdt32_t\t\tintval; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue