diff options
| -rw-r--r-- | drivers/net/fec.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 25df1b860c0b..a3565adc034c 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
| @@ -1359,6 +1359,8 @@ fec_drv_remove(struct platform_device *pdev) | |||
| 1359 | return 0; | 1359 | return 0; |
| 1360 | } | 1360 | } |
| 1361 | 1361 | ||
| 1362 | #ifdef CONFIG_PM | ||
| 1363 | |||
| 1362 | static int | 1364 | static int |
| 1363 | fec_suspend(struct platform_device *dev, pm_message_t state) | 1365 | fec_suspend(struct platform_device *dev, pm_message_t state) |
| 1364 | { | 1366 | { |
| @@ -1389,15 +1391,31 @@ fec_resume(struct platform_device *dev) | |||
| 1389 | return 0; | 1391 | return 0; |
| 1390 | } | 1392 | } |
| 1391 | 1393 | ||
| 1394 | static const struct dev_pm_ops fec_pm_ops = { | ||
| 1395 | .suspend = fec_suspend, | ||
| 1396 | .resume = fec_resume, | ||
| 1397 | .freeze = fec_suspend, | ||
| 1398 | .thaw = fec_resume, | ||
| 1399 | .poweroff = fec_suspend, | ||
| 1400 | .restore = fec_resume, | ||
| 1401 | }; | ||
| 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 */ | ||
| 1410 | |||
| 1392 | static struct platform_driver fec_driver = { | 1411 | static struct platform_driver fec_driver = { |
| 1393 | .driver = { | 1412 | .driver = { |
| 1394 | .name = "fec", | 1413 | .name = "fec", |
| 1395 | .owner = THIS_MODULE, | 1414 | .owner = THIS_MODULE, |
| 1415 | .pm = FEC_PM_OPS, | ||
| 1396 | }, | 1416 | }, |
| 1397 | .probe = fec_probe, | 1417 | .probe = fec_probe, |
| 1398 | .remove = __devexit_p(fec_drv_remove), | 1418 | .remove = __devexit_p(fec_drv_remove), |
| 1399 | .suspend = fec_suspend, | ||
| 1400 | .resume = fec_resume, | ||
| 1401 | }; | 1419 | }; |
| 1402 | 1420 | ||
| 1403 | static int __init | 1421 | static int __init |
