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>
This commit is contained in:
parent
2f5c54ce0d
commit
8963a50453
1 changed files with 3 additions and 4 deletions
|
@ -2466,6 +2466,7 @@ static int cpsw_remove(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM_SLEEP
|
||||||
static int cpsw_suspend(struct device *dev)
|
static int cpsw_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
|
@ -2518,11 +2519,9 @@ static int cpsw_resume(struct device *dev)
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static const struct dev_pm_ops cpsw_pm_ops = {
|
static SIMPLE_DEV_PM_OPS(cpsw_pm_ops, cpsw_suspend, cpsw_resume);
|
||||||
.suspend = cpsw_suspend,
|
|
||||||
.resume = cpsw_resume,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct of_device_id cpsw_of_mtable[] = {
|
static const struct of_device_id cpsw_of_mtable[] = {
|
||||||
{ .compatible = "ti,cpsw", },
|
{ .compatible = "ti,cpsw", },
|
||||||
|
|
Loading…
Add table
Reference in a new issue