Rather than the if/else construct, update OutputFile with the method to call to process each command. This is easier to maintain as the number of commands increases.
Rename generate_tables to generate_plat since it better describes what is being generated ('plat' is the U-Boot name for platform data). With this, each output method needs to have the same signature. Store the output structures in a member variable instead of using parameters, to accomplish this. Signed-off-by: Simon Glass <s...@chromium.org> --- tools/dtoc/dtb_platdata.py | 42 +++++++++++++++----------------------- 1 file changed, 16 insertions(+), 26 deletions(-) Applied to u-boot-dm/next, thanks!