Skip to content

Commit dac7213

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
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. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a3b6b32 commit dac7213

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8024,8 +8024,9 @@ int stmmac_resume(struct device *dev)
80248024
}
80258025
EXPORT_SYMBOL_GPL(stmmac_resume);
80268026

8027-
EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmmac_simple_pm_ops, stmmac_suspend,
8028-
stmmac_resume);
8027+
/* This is not the same as EXPORT_GPL_SIMPLE_DEV_PM_OPS() when CONFIG_PM=n */
8028+
DEFINE_SIMPLE_DEV_PM_OPS(stmmac_simple_pm_ops, stmmac_suspend, stmmac_resume);
8029+
EXPORT_SYMBOL_GPL(stmmac_simple_pm_ops);
80298030

80308031
#ifndef MODULE
80318032
static int __init stmmac_cmdline_opt(char *str)

0 commit comments

Comments
 (0)