Skip to contentSkip to conversation

ARM: stm32: Allow overriding setup_mac_address()

PATCH Superseded Marek Vasut 2 participants 2 messages Dec 18, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: stm32: Allow overriding setup_mac_address()

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.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>
---
 arch/arm/mach-stm32mp/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-stm32mp/cpu.c +1 -1
index ed7d9f61dc..856c7ced7a 100644
@@ -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;
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/1 ARM: stm32: Allow overriding setup_mac_address()

Hi Marek,

Quoted 9 lines

From: Marek Vasut <[email protected]>
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.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>
Quoted 9 lines
---
 arch/arm/mach-stm32mp/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-stm32mp/cpu.c index renamed from arch/arm/mach-stm32mp/cpu.c +0 -0

ed7d9f61dc..856c7ced7a 100644

arch/arm/mach-stm32mp/cpu.c static void setup_boot_mode(void) · line 452

Quoted 5 lines
arch/arm/mach-stm32mp/cpu.c +1 -1
@@ -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]

Quoted 5 lines
arch/arm/mach-stm32mp/cpu.c +0 -1
 {
 #if defined(CONFIG_NET)
 	int ret;
--

2.24.1

But anyway

Regards