Skip to content

Commit

Permalink
fec: convert legacy PM hooks to dem_pm_ops
Browse files Browse the repository at this point in the history
This patch compile tested only.

Convert legacy PM hooks to dev_pm_ops
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Denis Kirjanov authored and David S. Miller committed Jun 5, 2010
1 parent bb1d912 commit 59d4289
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions drivers/net/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,8 @@ fec_drv_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM

static int
fec_suspend(struct platform_device *dev, pm_message_t state)
{
Expand Down Expand Up @@ -1389,15 +1391,31 @@ fec_resume(struct platform_device *dev)
return 0;
}

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,
};

#define FEC_PM_OPS (&fec_pm_ops)

#else /* !CONFIG_PM */

#define FEC_PM_OPS NULL

#endif /* !CONFIG_PM */

static struct platform_driver fec_driver = {
.driver = {
.name = "fec",
.owner = THIS_MODULE,
.pm = FEC_PM_OPS,
},
.probe = fec_probe,
.remove = __devexit_p(fec_drv_remove),
.suspend = fec_suspend,
.resume = fec_resume,
};

static int __init
Expand Down

0 comments on commit 59d4289

Please sign in to comment.