diff options
author | Grygorii Strashko <Grygorii.Strashko@linaro.org> | 2015-02-27 06:19:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-01 13:40:22 -0500 |
commit | 8963a50453508a3f605dc2b29be35ee72d55335c (patch) | |
tree | f8f4bbf07735e4d1004710e5681de0e9e1af5c59 /drivers/net/ethernet | |
parent | 2f5c54ce0d11a527de3544e1b2c904544a2c1dd7 (diff) |
net: ti: cpsw: add hibernation callbacks
Setting a dev_pm_ops suspend/resume pair but not a set of
hibernation functions means those pm functions will not be
called upon hibernation.
Fix this by using SIMPLE_DEV_PM_OPS, which appropriately
assigns the suspend and hibernation handlers and move
cpsw_suspend/resume calbacks under CONFIG_PM_SLEEP
to avoid build warnings.
Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 49b03368f4b9..a1bbaf6352ba 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -2466,6 +2466,7 @@ static int cpsw_remove(struct platform_device *pdev) | |||
2466 | return 0; | 2466 | return 0; |
2467 | } | 2467 | } |
2468 | 2468 | ||
2469 | #ifdef CONFIG_PM_SLEEP | ||
2469 | static int cpsw_suspend(struct device *dev) | 2470 | static int cpsw_suspend(struct device *dev) |
2470 | { | 2471 | { |
2471 | struct platform_device *pdev = to_platform_device(dev); | 2472 | struct platform_device *pdev = to_platform_device(dev); |
@@ -2518,11 +2519,9 @@ static int cpsw_resume(struct device *dev) | |||
2518 | } | 2519 | } |
2519 | return 0; | 2520 | return 0; |
2520 | } | 2521 | } |
2522 | #endif | ||
2521 | 2523 | ||
2522 | static const struct dev_pm_ops cpsw_pm_ops = { | 2524 | static SIMPLE_DEV_PM_OPS(cpsw_pm_ops, cpsw_suspend, cpsw_resume); |
2523 | .suspend = cpsw_suspend, | ||
2524 | .resume = cpsw_resume, | ||
2525 | }; | ||
2526 | 2525 | ||
2527 | static const struct of_device_id cpsw_of_mtable[] = { | 2526 | static const struct of_device_id cpsw_of_mtable[] = { |
2528 | { .compatible = "ti,cpsw", }, | 2527 | { .compatible = "ti,cpsw", }, |