提交 dd66d386 编写于 作者: F Fabio Estevam 提交者: David S. Miller

fec: Simplify the PM related hooks

Get rid of the CONFIG_PM_SLEEP ifdef by annotating the suspend/resume functions
with '__maybe_unused' in order to keep the code simpler and shorter.

While at it, declare the suspend/resume functions in a single line.
Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e40f5c72
...@@ -2696,9 +2696,7 @@ fec_drv_remove(struct platform_device *pdev) ...@@ -2696,9 +2696,7 @@ fec_drv_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused fec_suspend(struct device *dev)
static int
fec_suspend(struct device *dev)
{ {
struct net_device *ndev = dev_get_drvdata(dev); struct net_device *ndev = dev_get_drvdata(dev);
struct fec_enet_private *fep = netdev_priv(ndev); struct fec_enet_private *fep = netdev_priv(ndev);
...@@ -2723,8 +2721,7 @@ fec_suspend(struct device *dev) ...@@ -2723,8 +2721,7 @@ fec_suspend(struct device *dev)
return 0; return 0;
} }
static int static int __maybe_unused fec_resume(struct device *dev)
fec_resume(struct device *dev)
{ {
struct net_device *ndev = dev_get_drvdata(dev); struct net_device *ndev = dev_get_drvdata(dev);
struct fec_enet_private *fep = netdev_priv(ndev); struct fec_enet_private *fep = netdev_priv(ndev);
...@@ -2759,7 +2756,6 @@ fec_resume(struct device *dev) ...@@ -2759,7 +2756,6 @@ fec_resume(struct device *dev)
regulator_disable(fep->reg_phy); regulator_disable(fep->reg_phy);
return ret; return ret;
} }
#endif /* CONFIG_PM_SLEEP */
static SIMPLE_DEV_PM_OPS(fec_pm_ops, fec_suspend, fec_resume); static SIMPLE_DEV_PM_OPS(fec_pm_ops, fec_suspend, fec_resume);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册