net: stmmac: fix stmmac_simple_pm_ops build errors
Subsystems (4)
PATCH 1/1 net: stmmac: fix stmmac_simple_pm_ops build errors
The kernel test robot reports that various drivers have an undefined reference to stmmac_simple_pm_ops. This is caused by EXPORT_SYMBOL_GPL_SIMPLE_DEV_PM_OPS() defining the struct as static and omitting the export when CONFIG_PM=n, unlike DEFINE_SIMPLE_PM_OPS() which still defines the struct non-static.
Switch to using DEFINE_SIMPLE_PM_OPS() + EXPORT_SYMBOL_GPL(), which means we always define stmmac_simple_pm_ops, and it will always be visible for dwmac-* to reference whether modular or built-in.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +3 -2
@@ -8024,8 +8024,9 @@ int stmmac_resume(struct device *dev) }EXPORT_SYMBOL_GPL (stmmac_resume); -EXPORT_GPL_SIMPLE_DEV_PM_OPS (stmmac_simple_pm_ops, stmmac_suspend, - stmmac_resume); +/* This is not the same as EXPORT_GPL_SIMPLE_DEV_PM_OPS() when CONFIG_PM=n */ +DEFINE_SIMPLE_DEV_PM_OPS (stmmac_simple_pm_ops, stmmac_suspend, stmmac_resume); +EXPORT_SYMBOL_GPL (stmmac_simple_pm_ops);#ifndef MODULE static int __init stmmac_cmdline_opt (char *str)
Signature · 1 line
2.30.2
Quoted 10 lines · Russell King (Oracle)
The kernel test robot reports that various drivers have an undefined reference to
stmmac_simple_pm_ops. This is caused byEXPORT_SYMBOL_GPL_SIMPLE_DEV_PM_OPS()defining the struct as static and omitting the export whenCONFIG_PM=n, unlikeDEFINE_SIMPLE_PM_OPS()which still defines the struct non-static.Switch to using
DEFINE_SIMPLE_PM_OPS()+EXPORT_SYMBOL_GPL(), which means we always definestmmac_simple_pm_ops, and it will always be visible for dwmac-* to reference whether modular or built-in.
Quoted 6 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Russell King (Oracle) <[email protected]>
Andrew
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 11 lines · On Wed, 20 Aug 2025 15:30:40 +0100 you wrote:
The kernel test robot reports that various drivers have an undefined reference to
stmmac_simple_pm_ops. This is caused byEXPORT_SYMBOL_GPL_SIMPLE_DEV_PM_OPS()defining the struct as static and omitting the export whenCONFIG_PM=n, unlikeDEFINE_SIMPLE_PM_OPS()which still defines the struct non-static.Switch to using
DEFINE_SIMPLE_PM_OPS()+EXPORT_SYMBOL_GPL(), which means we always definestmmac_simple_pm_ops, and it will always be visible for dwmac-* to reference whether modular or built-in.[...]
Here is the summary with links:
- [net-next] net: stmmac: fix stmmac_simple_pm_ops build errors
https://git.kernel.org/netdev/net-next/c/dac72136aa6b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Quoted 10 lines · Russell King (Oracle)
The kernel test robot reports that various drivers have an undefined reference to
stmmac_simple_pm_ops. This is caused byEXPORT_SYMBOL_GPL_SIMPLE_DEV_PM_OPS()defining the struct as static and omitting the export whenCONFIG_PM=n, unlikeDEFINE_SIMPLE_PM_OPS()which still defines the struct non-static.Switch to using
DEFINE_SIMPLE_PM_OPS()+EXPORT_SYMBOL_GPL(), which means we always definestmmac_simple_pm_ops, and it will always be visible for dwmac-* to reference whether modular or built-in.
Quoted 6 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Russell King (Oracle) <[email protected]>
Thanks.
Quoted 20 lines
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +3
-2@@ -8024,8 +8024,9 @@ int stmmac_resume(struct device *dev) }EXPORT_SYMBOL_GPL (stmmac_resume); -EXPORT_GPL_SIMPLE_DEV_PM_OPS (stmmac_simple_pm_ops, stmmac_suspend, - stmmac_resume); +/* This is not the same as EXPORT_GPL_SIMPLE_DEV_PM_OPS() when CONFIG_PM=n */ +DEFINE_SIMPLE_DEV_PM_OPS (stmmac_simple_pm_ops, stmmac_suspend, stmmac_resume); +EXPORT_SYMBOL_GPL (stmmac_simple_pm_ops);#ifndef MODULE static int __init stmmac_cmdline_opt (char *str)
Signature · 1 line
~Randy