-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathodroid-c-uboot-2015.04.06-leds-weak.patch
109 lines (100 loc) · 3.72 KB
/
odroid-c-uboot-2015.04.06-leds-weak.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
From c5d4001a1cbca546f83ec7f2299c664fb00e6451 Mon Sep 17 00:00:00 2001
From: Jeroen Hofstee <[email protected]>
Date: Mon, 23 Jun 2014 23:20:19 +0200
Subject: [PATCH] common: board_f: cosmetic use __attribute__((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 <[email protected]>
Signed-off-by: Jeroen Hofstee <[email protected]>
Acked-by: Simon Glass <[email protected]>
---
common/board_f.c | 29 ++++++++++-------------------
include/status_led.h | 22 +++++++++++-----------
2 files changed, 21 insertions(+), 30 deletions(-)
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 4ea4cb2..bdab38e 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -50,6 +50,7 @@
#include <onenand_uboot.h>
#include <mmc.h>
#include <asm/cache.h>
+#include <status_led.h>
#include <asm/arch/reboot.h>
#include <partition_table.h>
@@ -120,24 +121,15 @@ DECLARE_GLOBAL_DATA_PTR;
************************************************************************
* May be supplied by boards if desired
*/
-void inline __coloured_LED_init (void) {}
-void coloured_LED_init (void) __attribute__((weak, alias("__coloured_LED_init")));
-void inline __red_LED_on (void) {}
-void red_LED_on (void) __attribute__((weak, alias("__red_LED_on")));
-void inline __red_LED_off(void) {}
-void red_LED_off(void) __attribute__((weak, alias("__red_LED_off")));
-void inline __green_LED_on(void) {}
-void green_LED_on(void) __attribute__((weak, alias("__green_LED_on")));
-void inline __green_LED_off(void) {}
-void green_LED_off(void) __attribute__((weak, alias("__green_LED_off")));
-void inline __yellow_LED_on(void) {}
-void yellow_LED_on(void) __attribute__((weak, alias("__yellow_LED_on")));
-void inline __yellow_LED_off(void) {}
-void yellow_LED_off(void) __attribute__((weak, alias("__yellow_LED_off")));
-void inline __blue_LED_on(void) {}
-void blue_LED_on(void) __attribute__((weak, alias("__blue_LED_on")));
-void inline __blue_LED_off(void) {}
-void blue_LED_off(void) __attribute__((weak, alias("__blue_LED_off")));
+__attribute__((weak)) void coloured_LED_init(void) {}
+__attribute__((weak)) void red_led_on(void) {}
+__attribute__((weak)) void red_led_off(void) {}
+__attribute__((weak)) void green_led_on(void) {}
+__attribute__((weak)) void green_led_off(void) {}
+__attribute__((weak)) void yellow_led_on(void) {}
+__attribute__((weak)) void yellow_led_off(void) {}
+__attribute__((weak)) void blue_led_on(void) {}
+__attribute__((weak)) void blue_led_off(void) {}
/************************************************************************
* Init Utilities *
diff --git a/include/status_led.h b/include/status_led.h
index 0eb91b8..b8aaaf7 100644
--- a/include/status_led.h
+++ b/include/status_led.h
@@ -352,19 +352,21 @@ extern void __led_set (led_id_t mask, int state);
# include <asm/status_led.h>
#endif
+#endif /* CONFIG_STATUS_LED */
+
/*
* Coloured LEDs API
*/
#ifndef __ASSEMBLY__
-extern void coloured_LED_init (void);
-extern void red_LED_on(void);
-extern void red_LED_off(void);
-extern void green_LED_on(void);
-extern void green_LED_off(void);
-extern void yellow_LED_on(void);
-extern void yellow_LED_off(void);
-extern void blue_LED_on(void);
-extern void blue_LED_off(void);
+void coloured_LED_init(void);
+void red_led_on(void);
+void red_led_off(void);
+void green_led_on(void);
+void green_led_off(void);
+void yellow_led_on(void);
+void yellow_led_off(void);
+void blue_led_on(void);
+void blue_led_off(void);
#else
.extern LED_init
.extern red_LED_on
@@ -377,6 +379,4 @@ extern void blue_led_off(void);
.extern blue_LED_off
#endif
-#endif /* CONFIG_STATUS_LED */
-
#endif /* _STATUS_LED_H_ */
--
1.7.10.4