Skip to contentSkip to conversation

net: macb: fix use of at91_default_usrio without CONFIG_OF

PATCH Applied Conor Dooley 2 participants 2 messages Mar 31 – Apr 2

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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.

Fixes a17871778ee28 ("net: macb: rename macb_default_usrio to at91_default_usrio as not all platforms have mii mode control in usrio")

---
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.

CC Andrew Lunn <[email protected]>
CC David S. Miller <[email protected]>
CC Eric Dumazet <[email protected]>
CC Jakub Kicinski <[email protected]>
CC Paolo Abeni <[email protected]>
CC Nicolas Ferre <[email protected]>
CC Claudiu Beznea <[email protected]>
---
 drivers/net/ethernet/cadence/macb_main.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +7 -7
index 12e2b2f4aaf88..3e37b0a3e7e4b 100644
@@ -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
#1 lore raw
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_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.

[...]

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