Commit c5d4001a1cbca546f83ec7f2299c664fb00e6451
Committed by
Tom Rini
1 parent
0e350f81e1
Exists in
v2017.01-smarct4x
and in
37 other branches
common: board_f: cosmetic use __weak for leds
First of all this looks a lot better, but it also prevents a gcc warning (W=1), that the weak function has no previous prototype. cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Simon Glass <sjg@chromium.org>
Showing 2 changed files with 21 additions and 30 deletions Side-by-side Diff
common/board_f.c
... | ... | @@ -37,6 +37,7 @@ |
37 | 37 | #include <os.h> |
38 | 38 | #include <post.h> |
39 | 39 | #include <spi.h> |
40 | +#include <status_led.h> | |
40 | 41 | #include <trace.h> |
41 | 42 | #include <watchdog.h> |
42 | 43 | #include <asm/errno.h> |
... | ... | @@ -78,25 +79,15 @@ |
78 | 79 | ************************************************************************ |
79 | 80 | * May be supplied by boards if desired |
80 | 81 | */ |
81 | -inline void __coloured_LED_init(void) {} | |
82 | -void coloured_LED_init(void) | |
83 | - __attribute__((weak, alias("__coloured_LED_init"))); | |
84 | -inline void __red_led_on(void) {} | |
85 | -void red_led_on(void) __attribute__((weak, alias("__red_led_on"))); | |
86 | -inline void __red_led_off(void) {} | |
87 | -void red_led_off(void) __attribute__((weak, alias("__red_led_off"))); | |
88 | -inline void __green_led_on(void) {} | |
89 | -void green_led_on(void) __attribute__((weak, alias("__green_led_on"))); | |
90 | -inline void __green_led_off(void) {} | |
91 | -void green_led_off(void) __attribute__((weak, alias("__green_led_off"))); | |
92 | -inline void __yellow_led_on(void) {} | |
93 | -void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on"))); | |
94 | -inline void __yellow_led_off(void) {} | |
95 | -void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off"))); | |
96 | -inline void __blue_led_on(void) {} | |
97 | -void blue_led_on(void) __attribute__((weak, alias("__blue_led_on"))); | |
98 | -inline void __blue_led_off(void) {} | |
99 | -void blue_led_off(void) __attribute__((weak, alias("__blue_led_off"))); | |
82 | +__weak void coloured_LED_init(void) {} | |
83 | +__weak void red_led_on(void) {} | |
84 | +__weak void red_led_off(void) {} | |
85 | +__weak void green_led_on(void) {} | |
86 | +__weak void green_led_off(void) {} | |
87 | +__weak void yellow_led_on(void) {} | |
88 | +__weak void yellow_led_off(void) {} | |
89 | +__weak void blue_led_on(void) {} | |
90 | +__weak void blue_led_off(void) {} | |
100 | 91 | |
101 | 92 | /* |
102 | 93 | * Why is gd allocated a register? Prior to reloc it might be better to |
include/status_led.h
... | ... | @@ -272,19 +272,21 @@ |
272 | 272 | # include <asm/status_led.h> |
273 | 273 | #endif |
274 | 274 | |
275 | +#endif /* CONFIG_STATUS_LED */ | |
276 | + | |
275 | 277 | /* |
276 | 278 | * Coloured LEDs API |
277 | 279 | */ |
278 | 280 | #ifndef __ASSEMBLY__ |
279 | -extern void coloured_LED_init (void); | |
280 | -extern void red_led_on(void); | |
281 | -extern void red_led_off(void); | |
282 | -extern void green_led_on(void); | |
283 | -extern void green_led_off(void); | |
284 | -extern void yellow_led_on(void); | |
285 | -extern void yellow_led_off(void); | |
286 | -extern void blue_led_on(void); | |
287 | -extern void blue_led_off(void); | |
281 | +void coloured_LED_init(void); | |
282 | +void red_led_on(void); | |
283 | +void red_led_off(void); | |
284 | +void green_led_on(void); | |
285 | +void green_led_off(void); | |
286 | +void yellow_led_on(void); | |
287 | +void yellow_led_off(void); | |
288 | +void blue_led_on(void); | |
289 | +void blue_led_off(void); | |
288 | 290 | #else |
289 | 291 | .extern LED_init |
290 | 292 | .extern red_led_on |
... | ... | @@ -296,8 +298,6 @@ |
296 | 298 | .extern blue_led_on |
297 | 299 | .extern blue_led_off |
298 | 300 | #endif |
299 | - | |
300 | -#endif /* CONFIG_STATUS_LED */ | |
301 | 301 | |
302 | 302 | #endif /* _STATUS_LED_H_ */ |