diff mbox

[v2] fec: Use SIMPLE_DEV_PM_OPS

Message ID 1366136266-3324-1-git-send-email-fabio.estevam@freescale.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Fabio Estevam April 16, 2013, 6:17 p.m. UTC
Using SIMPLE_DEV_PM_OPS can make the code smaller and simpler.

Also change CONFIG_PM to CONFIG_PM_SLEEP.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Remove macro definition since SIMPLE_DEV_PM_OPS can handle CONFIG_PM_SLEEP
and !CONFIG_PM_SLEEP cases properly

 drivers/net/ethernet/freescale/fec_main.c |   15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

Comments

David Miller April 16, 2013, 8:38 p.m. UTC | #1
From: Fabio Estevam <fabio.estevam@freescale.com>
Date: Tue, 16 Apr 2013 15:17:46 -0300

> Using SIMPLE_DEV_PM_OPS can make the code smaller and simpler.
> 
> Also change CONFIG_PM to CONFIG_PM_SLEEP.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index e472670..aa9dc62 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1915,7 +1915,7 @@  fec_drv_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int
 fec_suspend(struct device *dev)
 {
@@ -1949,24 +1949,15 @@  fec_resume(struct device *dev)
 
 	return 0;
 }
+#endif /* CONFIG_PM_SLEEP */
 
-static const struct dev_pm_ops fec_pm_ops = {
-	.suspend	= fec_suspend,
-	.resume		= fec_resume,
-	.freeze		= fec_suspend,
-	.thaw		= fec_resume,
-	.poweroff	= fec_suspend,
-	.restore	= fec_resume,
-};
-#endif
+static SIMPLE_DEV_PM_OPS(fec_pm_ops, fec_suspend, fec_resume);
 
 static struct platform_driver fec_driver = {
 	.driver	= {
 		.name	= DRIVER_NAME,
 		.owner	= THIS_MODULE,
-#ifdef CONFIG_PM
 		.pm	= &fec_pm_ops,
-#endif
 		.of_match_table = fec_dt_ids,
 	},
 	.id_table = fec_devtype,