Skip to content

Commit 87cad5c

Browse files
Eric Benarddavem330
authored andcommitted
net/fec: clean suspend/resume
Commit 59d4289 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>
1 parent d05f6cf commit 87cad5c

1 file changed

Lines changed: 12 additions & 18 deletions

File tree

‎drivers/net/fec.c‎

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,11 +1360,10 @@ fec_drv_remove(struct platform_device *pdev)
13601360
}
13611361

13621362
#ifdef CONFIG_PM
1363-
13641363
static int
1365-
fec_suspend(struct platform_device *dev, pm_message_t state)
1364+
fec_suspend(struct device *dev)
13661365
{
1367-
struct net_device *ndev = platform_get_drvdata(dev);
1366+
struct net_device *ndev = dev_get_drvdata(dev);
13681367
struct fec_enet_private *fep;
13691368

13701369
if (ndev) {
@@ -1377,9 +1376,9 @@ fec_suspend(struct platform_device *dev, pm_message_t state)
13771376
}
13781377

13791378
static int
1380-
fec_resume(struct platform_device *dev)
1379+
fec_resume(struct device *dev)
13811380
{
1382-
struct net_device *ndev = platform_get_drvdata(dev);
1381+
struct net_device *ndev = dev_get_drvdata(dev);
13831382
struct fec_enet_private *fep;
13841383

13851384
if (ndev) {
@@ -1399,23 +1398,18 @@ static const struct dev_pm_ops fec_pm_ops = {
13991398
.poweroff = fec_suspend,
14001399
.restore = fec_resume,
14011400
};
1402-
1403-
#define FEC_PM_OPS (&fec_pm_ops)
1404-
1405-
#else /* !CONFIG_PM */
1406-
1407-
#define FEC_PM_OPS NULL
1408-
1409-
#endif /* !CONFIG_PM */
1401+
#endif
14101402

14111403
static struct platform_driver fec_driver = {
14121404
.driver = {
1413-
.name = "fec",
1414-
.owner = THIS_MODULE,
1415-
.pm = FEC_PM_OPS,
1405+
.name = "fec",
1406+
.owner = THIS_MODULE,
1407+
#ifdef CONFIG_PM
1408+
.pm = &fec_pm_ops,
1409+
#endif
14161410
},
1417-
.probe = fec_probe,
1418-
.remove = __devexit_p(fec_drv_remove),
1411+
.probe = fec_probe,
1412+
.remove = __devexit_p(fec_drv_remove),
14191413
};
14201414

14211415
static int __init

0 commit comments

Comments
 (0)