提交 0dfc3e18 编写于 作者: S Soren Brinkmann 提交者: David S. Miller

net: macb: Migrate to dev_pm_ops

Migrate the suspend/resume functions to use the dev_pm_ops PM interface.
Signed-off-by: NSoren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 fa08943b
...@@ -1946,8 +1946,9 @@ static int __exit macb_remove(struct platform_device *pdev) ...@@ -1946,8 +1946,9 @@ static int __exit macb_remove(struct platform_device *pdev)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int macb_suspend(struct platform_device *pdev, pm_message_t state) static int macb_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev);
struct net_device *netdev = platform_get_drvdata(pdev); struct net_device *netdev = platform_get_drvdata(pdev);
struct macb *bp = netdev_priv(netdev); struct macb *bp = netdev_priv(netdev);
...@@ -1960,8 +1961,9 @@ static int macb_suspend(struct platform_device *pdev, pm_message_t state) ...@@ -1960,8 +1961,9 @@ static int macb_suspend(struct platform_device *pdev, pm_message_t state)
return 0; return 0;
} }
static int macb_resume(struct platform_device *pdev) static int macb_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev);
struct net_device *netdev = platform_get_drvdata(pdev); struct net_device *netdev = platform_get_drvdata(pdev);
struct macb *bp = netdev_priv(netdev); struct macb *bp = netdev_priv(netdev);
...@@ -1972,19 +1974,17 @@ static int macb_resume(struct platform_device *pdev) ...@@ -1972,19 +1974,17 @@ static int macb_resume(struct platform_device *pdev)
return 0; return 0;
} }
#else
#define macb_suspend NULL
#define macb_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(macb_pm_ops, macb_suspend, macb_resume);
static struct platform_driver macb_driver = { static struct platform_driver macb_driver = {
.remove = __exit_p(macb_remove), .remove = __exit_p(macb_remove),
.suspend = macb_suspend,
.resume = macb_resume,
.driver = { .driver = {
.name = "macb", .name = "macb",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = of_match_ptr(macb_dt_ids), .of_match_table = of_match_ptr(macb_dt_ids),
.pm = &macb_pm_ops,
}, },
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册