diff mbox series

ARM: stm32: Allow overriding setup_mac_address()

Message ID 20191218065835.12131-1-marex@denx.de
State Superseded
Delegated to: Patrick Delaunay
Headers show
Series ARM: stm32: Allow overriding setup_mac_address() | expand

Commit Message

Marek Vasut Dec. 18, 2019, 6:58 a.m. UTC
Let board code override setup_mac_address(), which is useful e.g. if the
board derives the MAC address from another source, like an I2C EEPROM.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
---
 arch/arm/mach-stm32mp/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Patrick DELAUNAY Dec. 18, 2019, 12:31 p.m. UTC | #1
Hi Marek,

> From: Marek Vasut <marex@denx.de>
> Sent: mercredi 18 décembre 2019 07:59
> 
> Let board code override setup_mac_address(), which is useful e.g. if the board
> derives the MAC address from another source, like an I2C EEPROM.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Patrick Delaunay <patrick.delaunay@st.com>
> Cc: Patrice Chotard <patrice.chotard@st.com>

Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>

> ---
>  arch/arm/mach-stm32mp/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c index
> ed7d9f61dc..856c7ced7a 100644
> --- a/arch/arm/mach-stm32mp/cpu.c
> +++ b/arch/arm/mach-stm32mp/cpu.c
> @@ -449,7 +449,7 @@ static void setup_boot_mode(void)
>   * If there is no MAC address in the environment, then it will be initialized
>   * (silently) from the value in the OTP.
>   */
> -static int setup_mac_address(void)
> +__weak int setup_mac_address(void)

Perhaps add prototype in:
arch/arm/mach-stm32mp/include/mach/sys_proto.h

just to avoid the new warning with W=1

warning: no previous prototype for 'setup_mac_address' [-Wmissing-prototypes]


>  {
>  #if defined(CONFIG_NET)
>  	int ret;
> --
> 2.24.1

But anyway

Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>

Regards
diff mbox series

Patch

diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c
index ed7d9f61dc..856c7ced7a 100644
--- a/arch/arm/mach-stm32mp/cpu.c
+++ b/arch/arm/mach-stm32mp/cpu.c
@@ -449,7 +449,7 @@  static void setup_boot_mode(void)
  * If there is no MAC address in the environment, then it will be initialized
  * (silently) from the value in the OTP.
  */
-static int setup_mac_address(void)
+__weak int setup_mac_address(void)
 {
 #if defined(CONFIG_NET)
 	int ret;