Skip to content

Commit de6c7b9

Browse files
Fabio Estevamkuba-moo
authored andcommitted
net: fec: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Peng Fan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 3f49edf commit de6c7b9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4606,7 +4606,7 @@ fec_drv_remove(struct platform_device *pdev)
46064606
free_netdev(ndev);
46074607
}
46084608

4609-
static int __maybe_unused fec_suspend(struct device *dev)
4609+
static int fec_suspend(struct device *dev)
46104610
{
46114611
struct net_device *ndev = dev_get_drvdata(dev);
46124612
struct fec_enet_private *fep = netdev_priv(ndev);
@@ -4659,7 +4659,7 @@ static int __maybe_unused fec_suspend(struct device *dev)
46594659
return 0;
46604660
}
46614661

4662-
static int __maybe_unused fec_resume(struct device *dev)
4662+
static int fec_resume(struct device *dev)
46634663
{
46644664
struct net_device *ndev = dev_get_drvdata(dev);
46654665
struct fec_enet_private *fep = netdev_priv(ndev);
@@ -4714,7 +4714,7 @@ static int __maybe_unused fec_resume(struct device *dev)
47144714
return ret;
47154715
}
47164716

4717-
static int __maybe_unused fec_runtime_suspend(struct device *dev)
4717+
static int fec_runtime_suspend(struct device *dev)
47184718
{
47194719
struct net_device *ndev = dev_get_drvdata(dev);
47204720
struct fec_enet_private *fep = netdev_priv(ndev);
@@ -4725,7 +4725,7 @@ static int __maybe_unused fec_runtime_suspend(struct device *dev)
47254725
return 0;
47264726
}
47274727

4728-
static int __maybe_unused fec_runtime_resume(struct device *dev)
4728+
static int fec_runtime_resume(struct device *dev)
47294729
{
47304730
struct net_device *ndev = dev_get_drvdata(dev);
47314731
struct fec_enet_private *fep = netdev_priv(ndev);
@@ -4746,14 +4746,14 @@ static int __maybe_unused fec_runtime_resume(struct device *dev)
47464746
}
47474747

47484748
static const struct dev_pm_ops fec_pm_ops = {
4749-
SET_SYSTEM_SLEEP_PM_OPS(fec_suspend, fec_resume)
4750-
SET_RUNTIME_PM_OPS(fec_runtime_suspend, fec_runtime_resume, NULL)
4749+
SYSTEM_SLEEP_PM_OPS(fec_suspend, fec_resume)
4750+
RUNTIME_PM_OPS(fec_runtime_suspend, fec_runtime_resume, NULL)
47514751
};
47524752

47534753
static struct platform_driver fec_driver = {
47544754
.driver = {
47554755
.name = DRIVER_NAME,
4756-
.pm = &fec_pm_ops,
4756+
.pm = pm_ptr(&fec_pm_ops),
47574757
.of_match_table = fec_dt_ids,
47584758
.suppress_bind_attrs = true,
47594759
},

0 commit comments

Comments
 (0)