Skip to contentSkip to conversation

net: davinci_mdio: add hibernation callbacks

PATCH Applied [email protected] 2 participants 4 messages Feb 27, 2015 – Mar 2, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net: davinci_mdio: add hibernation callbacks

From: Grygorii Strashko <[email protected]>

Setting a dev_pm_ops suspend_late/resume_early pair but not a set of hibernation functions means those pm functions will not be called upon hibernation.
Fix this by using SET_LATE_SYSTEM_SLEEP_PM_OPS, which appropriately assigns the suspend and hibernation handlers and move davinci_mdio_x callbacks under CONFIG_PM_SLEEP to avoid build warnings.

---
 drivers/net/ethernet/ti/davinci_mdio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/ti/davinci_mdio.c +3 -2
index e58f0a7..25871dc 100644
@@ -438,6 +438,7 @@ static int davinci_mdio_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int davinci_mdio_suspend(struct device *dev)
 {
 	struct davinci_mdio_data *data = dev_get_drvdata(dev);
@@ -479,10 +480,10 @@ static int davinci_mdio_resume(struct device *dev)
 
 	return 0;
 }
+#endif
 
 static const struct dev_pm_ops davinci_mdio_pm_ops = {
-	.suspend_late	= davinci_mdio_suspend,
-	.resume_early	= davinci_mdio_resume,
+	SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
 };
 
 #if IS_ENABLED(CONFIG_OF)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 net: ti: cpsw: add hibernation callbacks

From: Grygorii Strashko <[email protected]>

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.

---
 drivers/net/ethernet/ti/cpsw.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/ti/cpsw.c +3 -4
index 8704954..b4fcf5f 100644
@@ -2805,6 +2805,7 @@ static int cpsw_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int cpsw_suspend(struct device *dev)
 {
 	struct platform_device	*pdev = to_platform_device(dev);
@@ -2857,11 +2858,9 @@ static int cpsw_resume(struct device *dev)
 	}
 	return 0;
 }
+#endif
 
-static const struct dev_pm_ops cpsw_pm_ops = {
-	.suspend	= cpsw_suspend,
-	.resume		= cpsw_resume,
-};
+static SIMPLE_DEV_PM_OPS(cpsw_pm_ops, cpsw_suspend, cpsw_resume);
 
 static const struct of_device_id cpsw_of_mtable[] = {
 	{ .compatible = "ti,cpsw", },
Signature · 1 line
1.9.1
maintainer Applied
#2 lore raw

Re: [PATCH 2/2] net: ti: cpsw: add hibernation callbacks

From: <[email protected]>
Date: Fri, 27 Feb 2015 13:19:45 +0200

Quoted 11 lines

From: Grygorii Strashko <[email protected]>

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.

Applied.

maintainer Applied
#3 lore raw
In reply to [email protected]

From: <[email protected]>
Date: Fri, 27 Feb 2015 13:19:44 +0200

Quoted 10 lines

From: Grygorii Strashko <[email protected]>

Setting a dev_pm_ops suspend_late/resume_early pair but not a set of hibernation functions means those pm functions will not be called upon hibernation.
Fix this by using SET_LATE_SYSTEM_SLEEP_PM_OPS, which appropriately assigns the suspend and hibernation handlers and move davinci_mdio_x callbacks under CONFIG_PM_SLEEP to avoid build warnings.

Applied.