Commit bf7bfd7f authored by Fabio Estevam's avatar Fabio Estevam Committed by David S. Miller

fec: Use SIMPLE_DEV_PM_OPS

Using SIMPLE_DEV_PM_OPS can make the code smaller and simpler.

Also change CONFIG_PM to CONFIG_PM_SLEEP.
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 474f315d
...@@ -1909,7 +1909,7 @@ fec_drv_remove(struct platform_device *pdev) ...@@ -1909,7 +1909,7 @@ fec_drv_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int static int
fec_suspend(struct device *dev) fec_suspend(struct device *dev)
{ {
...@@ -1941,24 +1941,15 @@ fec_resume(struct device *dev) ...@@ -1941,24 +1941,15 @@ fec_resume(struct device *dev)
return 0; return 0;
} }
#endif /* CONFIG_PM_SLEEP */
static const struct dev_pm_ops fec_pm_ops = { static SIMPLE_DEV_PM_OPS(fec_pm_ops, fec_suspend, fec_resume);
.suspend = fec_suspend,
.resume = fec_resume,
.freeze = fec_suspend,
.thaw = fec_resume,
.poweroff = fec_suspend,
.restore = fec_resume,
};
#endif
static struct platform_driver fec_driver = { static struct platform_driver fec_driver = {
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &fec_pm_ops, .pm = &fec_pm_ops,
#endif
.of_match_table = fec_dt_ids, .of_match_table = fec_dt_ids,
}, },
.id_table = fec_devtype, .id_table = fec_devtype,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment