diff options
Diffstat (limited to 'drivers/rtc/rtc-sh.c')
-rw-r--r-- | drivers/rtc/rtc-sh.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index e55a7635ae5f..8d5bd2e36776 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c | |||
@@ -790,6 +790,7 @@ static void sh_rtc_set_irq_wake(struct device *dev, int enabled) | |||
790 | } | 790 | } |
791 | } | 791 | } |
792 | 792 | ||
793 | #ifdef CONFIG_PM_SLEEP | ||
793 | static int sh_rtc_suspend(struct device *dev) | 794 | static int sh_rtc_suspend(struct device *dev) |
794 | { | 795 | { |
795 | if (device_may_wakeup(dev)) | 796 | if (device_may_wakeup(dev)) |
@@ -805,33 +806,20 @@ static int sh_rtc_resume(struct device *dev) | |||
805 | 806 | ||
806 | return 0; | 807 | return 0; |
807 | } | 808 | } |
809 | #endif | ||
808 | 810 | ||
809 | static const struct dev_pm_ops sh_rtc_dev_pm_ops = { | 811 | static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume); |
810 | .suspend = sh_rtc_suspend, | ||
811 | .resume = sh_rtc_resume, | ||
812 | }; | ||
813 | 812 | ||
814 | static struct platform_driver sh_rtc_platform_driver = { | 813 | static struct platform_driver sh_rtc_platform_driver = { |
815 | .driver = { | 814 | .driver = { |
816 | .name = DRV_NAME, | 815 | .name = DRV_NAME, |
817 | .owner = THIS_MODULE, | 816 | .owner = THIS_MODULE, |
818 | .pm = &sh_rtc_dev_pm_ops, | 817 | .pm = &sh_rtc_pm_ops, |
819 | }, | 818 | }, |
820 | .remove = __exit_p(sh_rtc_remove), | 819 | .remove = __exit_p(sh_rtc_remove), |
821 | }; | 820 | }; |
822 | 821 | ||
823 | static int __init sh_rtc_init(void) | 822 | module_platform_driver_probe(sh_rtc_platform_driver, sh_rtc_probe); |
824 | { | ||
825 | return platform_driver_probe(&sh_rtc_platform_driver, sh_rtc_probe); | ||
826 | } | ||
827 | |||
828 | static void __exit sh_rtc_exit(void) | ||
829 | { | ||
830 | platform_driver_unregister(&sh_rtc_platform_driver); | ||
831 | } | ||
832 | |||
833 | module_init(sh_rtc_init); | ||
834 | module_exit(sh_rtc_exit); | ||
835 | 823 | ||
836 | MODULE_DESCRIPTION("SuperH on-chip RTC driver"); | 824 | MODULE_DESCRIPTION("SuperH on-chip RTC driver"); |
837 | MODULE_VERSION(DRV_VERSION); | 825 | MODULE_VERSION(DRV_VERSION); |