diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-06-22 08:39:41 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2016-07-11 10:47:53 -0400 |
commit | da35cbcafad3d46daa96a6f01022f11842e8e7b6 (patch) | |
tree | b098571e4069ca41a1bf83b3be878a183685628a | |
parent | fa45caf2ee319fc8cb6ba5c7e6ff8cb36efc0d1a (diff) |
ARM: tegra: Remove board_init_funcs array
In a configuration that enables CONFIG_UBSAN_SANITIZE_ALL, I am getting
a section mismatch warning for tegra20:
WARNING: arch/arm/mach-tegra/built-in.o(.data+0x6e0): Section mismatch in reference from the variable board_init_funcs to the function .init.text:paz00_init()
The array is no longer useful here since there is only one entry,
so we can simply call the function directly after checking
of_machine_is_compatible(). This fixes the section mismatch
and is easier to read.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/tegra.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c index 2378fa560a21..42d7ee9658fa 100644 --- a/arch/arm/mach-tegra/tegra.c +++ b/arch/arm/mach-tegra/tegra.c | |||
@@ -118,32 +118,14 @@ out: | |||
118 | of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); | 118 | of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); |
119 | } | 119 | } |
120 | 120 | ||
121 | static void __init paz00_init(void) | ||
122 | { | ||
123 | if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) | ||
124 | tegra_paz00_wifikill_init(); | ||
125 | } | ||
126 | |||
127 | static struct { | ||
128 | char *machine; | ||
129 | void (*init)(void); | ||
130 | } board_init_funcs[] = { | ||
131 | { "compal,paz00", paz00_init }, | ||
132 | }; | ||
133 | |||
134 | static void __init tegra_dt_init_late(void) | 121 | static void __init tegra_dt_init_late(void) |
135 | { | 122 | { |
136 | int i; | ||
137 | |||
138 | tegra_init_suspend(); | 123 | tegra_init_suspend(); |
139 | tegra_cpuidle_init(); | 124 | tegra_cpuidle_init(); |
140 | 125 | ||
141 | for (i = 0; i < ARRAY_SIZE(board_init_funcs); i++) { | 126 | if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && |
142 | if (of_machine_is_compatible(board_init_funcs[i].machine)) { | 127 | of_machine_is_compatible("compal,paz00")) |
143 | board_init_funcs[i].init(); | 128 | tegra_paz00_wifikill_init(); |
144 | break; | ||
145 | } | ||
146 | } | ||
147 | } | 129 | } |
148 | 130 | ||
149 | static const char * const tegra_dt_board_compat[] = { | 131 | static const char * const tegra_dt_board_compat[] = { |