summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2019-04-16 13:31:58 +0200
committerTom Rini <trini@konsulko.com>2019-04-26 18:58:20 -0400
commite9cde87ec1eaba3b5233093aec8f4f6c256b3a54 (patch)
tree0b1d3e89ee53e349b79049638d0caca6261a9db4 /tools
parent1627e5e5985d92bebdbfb19ab783eaf69337900e (diff)
downloadu-boot-e9cde87ec1eaba3b5233093aec8f4f6c256b3a54.tar.gz
u-boot-e9cde87ec1eaba3b5233093aec8f4f6c256b3a54.tar.xz
u-boot-e9cde87ec1eaba3b5233093aec8f4f6c256b3a54.zip
dtb_platdata.py: prevent define generation of alias
generate define for an alias only if the struct is not created already. This prevents compilerwarning: PLAT spl/dts/dt-platdata.o spl/dts/dt-platdata.c:11:46: error: missing braces around initializer [-Werror=missing-braces] static const struct dtd_simple_bus dtv_ahb = { ^ spl/dts/dt-platdata.c:20:46: error: missing braces around initializer [-Werror=missing-braces] static const struct dtd_simple_bus dtv_apb = { ^ cc1: all warnings being treated as errors on the at91 based taurus board. Reason is in at91sam9260.dtsi is defined: ahb { compatible = "simple-bus"; ranges; and later: pinctrl: pinctrl@fffff400 { compatible = "atmel,at91rm9200-pinctrl", "simple-bus"; ranges = <0xfffff400 0xfffff400 0x600>; without this patch dtoc generates: struct dtd_atmel_at91rm9200_pinctrl { fdt32_t atmel_mux_mask[6]; fdt32_t ranges[3]; fdt32_t reg[6]; }; struct dtd_simple_bus { bool ranges; }; "#define dtd_simple_bus dtd_atmel_at91rm9200_pinctrl" and the line with "define dtd_simple_bus..." introduces the warning. This define is not needed. Signed-off-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'tools')
-rw-r--r--tools/dtoc/dtb_platdata.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index ca580b45d4..17a3dccb11 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -450,8 +450,9 @@ class DtbPlatdata(object):
self.out('};\n')
for alias, struct_name in self._aliases.iteritems():
- self.out('#define %s%s %s%s\n'% (STRUCT_PREFIX, alias,
- STRUCT_PREFIX, struct_name))
+ if alias not in sorted(structs):
+ self.out('#define %s%s %s%s\n'% (STRUCT_PREFIX, alias,
+ STRUCT_PREFIX, struct_name))
def output_node(self, node):
"""Output the C code for a node