Commit 87cad5c3 authored by Eric Benard's avatar Eric Benard Committed by David S. Miller

net/fec: clean suspend/resume

Commit 59d4289b converted fec to dev_pm_ops but
didn't update the suspend/resume functions thus leading to the following warning :
"initialization from incompatible pointer type" when CONFIG_PM is set.

This patch also fixe a few indentation and style around CONFIG_PM area.
Signed-off-by: default avatarEric Bénard <eric@eukrea.com>
Cc: netdev@vger.kernel.org
Cc: davem@davemloft.net
Cc: amit.kucheria@canonical.com
Cc: s.hauer@pengutronix.de
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d05f6cf0
...@@ -1360,11 +1360,10 @@ fec_drv_remove(struct platform_device *pdev) ...@@ -1360,11 +1360,10 @@ fec_drv_remove(struct platform_device *pdev)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int static int
fec_suspend(struct platform_device *dev, pm_message_t state) fec_suspend(struct device *dev)
{ {
struct net_device *ndev = platform_get_drvdata(dev); struct net_device *ndev = dev_get_drvdata(dev);
struct fec_enet_private *fep; struct fec_enet_private *fep;
if (ndev) { if (ndev) {
...@@ -1377,9 +1376,9 @@ fec_suspend(struct platform_device *dev, pm_message_t state) ...@@ -1377,9 +1376,9 @@ fec_suspend(struct platform_device *dev, pm_message_t state)
} }
static int static int
fec_resume(struct platform_device *dev) fec_resume(struct device *dev)
{ {
struct net_device *ndev = platform_get_drvdata(dev); struct net_device *ndev = dev_get_drvdata(dev);
struct fec_enet_private *fep; struct fec_enet_private *fep;
if (ndev) { if (ndev) {
...@@ -1399,23 +1398,18 @@ static const struct dev_pm_ops fec_pm_ops = { ...@@ -1399,23 +1398,18 @@ static const struct dev_pm_ops fec_pm_ops = {
.poweroff = fec_suspend, .poweroff = fec_suspend,
.restore = fec_resume, .restore = fec_resume,
}; };
#endif
#define FEC_PM_OPS (&fec_pm_ops)
#else /* !CONFIG_PM */
#define FEC_PM_OPS NULL
#endif /* !CONFIG_PM */
static struct platform_driver fec_driver = { static struct platform_driver fec_driver = {
.driver = { .driver = {
.name = "fec", .name = "fec",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = FEC_PM_OPS, #ifdef CONFIG_PM
.pm = &fec_pm_ops,
#endif
}, },
.probe = fec_probe, .probe = fec_probe,
.remove = __devexit_p(fec_drv_remove), .remove = __devexit_p(fec_drv_remove),
}; };
static int __init static int __init
......
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