summaryrefslogtreecommitdiffstats
path: root/drivers/net/fec.c
diff options
context:
space:
mode:
authorEric Benard <eric@eukrea.com>2010-06-18 04:19:54 +0000
committerDavid S. Miller <davem@davemloft.net>2010-06-25 21:33:14 -0700
commit87cad5c385877ce45244886748564672fd6db035 (patch)
treef8b11f2281545b46b0865372e61a722487699088 /drivers/net/fec.c
parentd05f6cf01cc5241ddaca6e122021e64441fe08f3 (diff)
downloadlinux-87cad5c385877ce45244886748564672fd6db035.tar.bz2
net/fec: clean suspend/resume
Commit 59d4289b83b11379d867e2f7146904b19cc96404 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: Eric 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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fec.c')
-rw-r--r--drivers/net/fec.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index a3cae4ed6ac9..b4afd7a6ee29 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1360,11 +1360,10 @@ fec_drv_remove(struct platform_device *pdev)
}
#ifdef CONFIG_PM
-
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;
if (ndev) {
@@ -1377,9 +1376,9 @@ fec_suspend(struct platform_device *dev, pm_message_t state)
}
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;
if (ndev) {
@@ -1399,23 +1398,18 @@ static const struct dev_pm_ops fec_pm_ops = {
.poweroff = fec_suspend,
.restore = fec_resume,
};
-
-#define FEC_PM_OPS (&fec_pm_ops)
-
-#else /* !CONFIG_PM */
-
-#define FEC_PM_OPS NULL
-
-#endif /* !CONFIG_PM */
+#endif
static struct platform_driver fec_driver = {
.driver = {
- .name = "fec",
- .owner = THIS_MODULE,
- .pm = FEC_PM_OPS,
+ .name = "fec",
+ .owner = THIS_MODULE,
+#ifdef CONFIG_PM
+ .pm = &fec_pm_ops,
+#endif
},
- .probe = fec_probe,
- .remove = __devexit_p(fec_drv_remove),
+ .probe = fec_probe,
+ .remove = __devexit_p(fec_drv_remove),
};
static int __init