diff options
-rw-r--r-- | drivers/rtc/rtc-pxa.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/rtc/rtc-pxa.c b/drivers/rtc/rtc-pxa.c index bb8cc05605ac..747ca194fad4 100644 --- a/drivers/rtc/rtc-pxa.c +++ b/drivers/rtc/rtc-pxa.c | |||
@@ -438,34 +438,37 @@ static int __exit pxa_rtc_remove(struct platform_device *pdev) | |||
438 | } | 438 | } |
439 | 439 | ||
440 | #ifdef CONFIG_PM | 440 | #ifdef CONFIG_PM |
441 | static int pxa_rtc_suspend(struct platform_device *pdev, pm_message_t state) | 441 | static int pxa_rtc_suspend(struct device *dev) |
442 | { | 442 | { |
443 | struct pxa_rtc *pxa_rtc = platform_get_drvdata(pdev); | 443 | struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev); |
444 | 444 | ||
445 | if (device_may_wakeup(&pdev->dev)) | 445 | if (device_may_wakeup(dev)) |
446 | enable_irq_wake(pxa_rtc->irq_Alrm); | 446 | enable_irq_wake(pxa_rtc->irq_Alrm); |
447 | return 0; | 447 | return 0; |
448 | } | 448 | } |
449 | 449 | ||
450 | static int pxa_rtc_resume(struct platform_device *pdev) | 450 | static int pxa_rtc_resume(struct device *dev) |
451 | { | 451 | { |
452 | struct pxa_rtc *pxa_rtc = platform_get_drvdata(pdev); | 452 | struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev); |
453 | 453 | ||
454 | if (device_may_wakeup(&pdev->dev)) | 454 | if (device_may_wakeup(dev)) |
455 | disable_irq_wake(pxa_rtc->irq_Alrm); | 455 | disable_irq_wake(pxa_rtc->irq_Alrm); |
456 | return 0; | 456 | return 0; |
457 | } | 457 | } |
458 | #else | 458 | |
459 | #define pxa_rtc_suspend NULL | 459 | static struct dev_pm_ops pxa_rtc_pm_ops = { |
460 | #define pxa_rtc_resume NULL | 460 | .suspend = pxa_rtc_suspend, |
461 | .resume = pxa_rtc_resume, | ||
462 | }; | ||
461 | #endif | 463 | #endif |
462 | 464 | ||
463 | static struct platform_driver pxa_rtc_driver = { | 465 | static struct platform_driver pxa_rtc_driver = { |
464 | .remove = __exit_p(pxa_rtc_remove), | 466 | .remove = __exit_p(pxa_rtc_remove), |
465 | .suspend = pxa_rtc_suspend, | ||
466 | .resume = pxa_rtc_resume, | ||
467 | .driver = { | 467 | .driver = { |
468 | .name = "pxa-rtc", | 468 | .name = "pxa-rtc", |
469 | #ifdef CONFIG_PM | ||
470 | .pm = &pxa_rtc_pm_ops, | ||
471 | #endif | ||
469 | }, | 472 | }, |
470 | }; | 473 | }; |
471 | 474 | ||