* [U-Boot] [PATCH] mxs: Use __weak annotation to simplify code
@ 2013-01-08 15:21 Fabio Estevam
2013-01-08 15:28 ` Marek Vasut
0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2013-01-08 15:21 UTC (permalink / raw)
To: u-boot
Using the __weak annotation can make the code cleaner.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/cpu/arm926ejs/mxs/mxs.c | 6 ++----
arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c | 5 ++---
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/mxs/mxs.c b/arch/arm/cpu/arm926ejs/mxs/mxs.c
index 6ce8019..741ae38 100644
--- a/arch/arm/cpu/arm926ejs/mxs/mxs.c
+++ b/arch/arm/cpu/arm926ejs/mxs/mxs.c
@@ -35,6 +35,7 @@
#include <asm/arch/iomux.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/sys_proto.h>
+#include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -276,7 +277,7 @@ int cpu_eth_init(bd_t *bis)
}
#endif
-static void __mx28_adjust_mac(int dev_id, unsigned char *mac)
+__weak void mx28_adjust_mac(int dev_id, unsigned char *mac)
{
mac[0] = 0x00;
mac[1] = 0x04; /* Use FSL vendor MAC address by default */
@@ -285,9 +286,6 @@ static void __mx28_adjust_mac(int dev_id, unsigned char *mac)
mac[5] += 1;
}
-void mx28_adjust_mac(int dev_id, unsigned char *mac)
- __attribute__((weak, alias("__mx28_adjust_mac")));
-
#ifdef CONFIG_MX28_FEC_MAC_IN_OCOTP
#define MXS_OCOTP_MAX_TIMEOUT 1000000
diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c b/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
index 401c513..a3ff3fa 100644
--- a/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
+++ b/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
@@ -27,6 +27,7 @@
#include <config.h>
#include <asm/io.h>
#include <asm/arch/imx-regs.h>
+#include <linux/compiler.h>
#include "mxs_init.h"
@@ -88,11 +89,9 @@ static uint32_t dram_vals[] = {
#endif
};
-void __mxs_adjust_memory_params(uint32_t *dram_vals)
+__weak void mxs_adjust_memory_params(uint32_t *dram_vals)
{
}
-void mxs_adjust_memory_params(uint32_t *dram_vals)
- __attribute__((weak, alias("__mxs_adjust_memory_params")));
static void initialize_dram_values(void)
{
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] mxs: Use __weak annotation to simplify code
2013-01-08 15:21 [U-Boot] [PATCH] mxs: Use __weak annotation to simplify code Fabio Estevam
@ 2013-01-08 15:28 ` Marek Vasut
0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2013-01-08 15:28 UTC (permalink / raw)
To: u-boot
Dear Fabio Estevam,
> Using the __weak annotation can make the code cleaner.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Marek Vasut <marex@denx.de>
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-08 15:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-08 15:21 [U-Boot] [PATCH] mxs: Use __weak annotation to simplify code Fabio Estevam
2013-01-08 15:28 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox