net: macb: fix use of at91_default_usrio without CONFIG_OF
Subsystems (4)
PATCH v2 1/1 net: macb: fix use of at91_default_usrio without CONFIG_OF
From: Conor Dooley <[email protected]>
If CONFIG_OF is not enabled, at91_default_usrio is used undeclared in gem_default_config. Move at91_default_usrio back above the CONFIG_OF section where macb_default_usrio used to be, so that it is unconditionally defined and defined prior to any of the users.
---
lkp also reported this over the weekend, but against the dev copy in my tree. I had thought that CONFIG_OF was standard off on x86, but I guess it isn't, given lkp didn't catch it until randconfigs.
Seem to have come down with some sort of bug, hopefully I haven't cocked this v2 up somehow in my addled state.
v2:
- Do the boring thing that works... Probably worth a revisit later, cos there's a bunch of confusing naming here still - "default_gem_config" is used for cdns,macb and of course "at91_default_usrio" is used on things where I am reasonably confident it shouldn't, like the Xilinx boards.
--- drivers/net/ethernet/cadence/macb_main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +7 -7
@@ -4949,6 +4949,13 @@ static int macb_init(struct platform_device *pdev,return macb_init_dflt (pdev); } +static const struct macb_usrio_config at91_default_usrio = { + .mii =MACB_BIT (MII ), + .rmii =MACB_BIT (RMII ), + .rgmii =GEM_BIT (RGMII ), + .clken =MACB_BIT (CLKEN ), +}; +#if defined(CONFIG_OF )/* 1518 rounded up */ #define AT91ETHER_MAX_RBUFF_SZ 0x600
@@ -5523,13 +5530,6 @@ static int eyeq5_init(struct platform_device *pdev)return ret; } -static const struct macb_usrio_config at91_default_usrio = { - .mii =MACB_BIT (MII ), - .rmii =MACB_BIT (RMII ), - .rgmii =GEM_BIT (RGMII ), - .clken =MACB_BIT (CLKEN ), -}; -static const struct macb_usrio_config mpfs_usrio = { .tsu_source =0 , };
Signature · 1 line
2.53.0
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Tue, 31 Mar 2026 14:10:21 +0100 you wrote:
From: Conor Dooley <[email protected]>
If
CONFIG_OFis not enabled,at91_default_usriois used undeclared ingem_default_config. Moveat91_default_usrioback above theCONFIG_OFsection wheremacb_default_usrioused to be, so that it is unconditionally defined and defined prior to any of the users.[...]
Here is the summary with links:
- [net-next,v2] net: macb: fix use of at91_default_usrio without CONFIG_OF
https://git.kernel.org/netdev/net-next/c/cee10a01e286
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html