diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:20:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:32 -0400 |
commit | 0ed5054447462976b7577ccf08d422c93ea38095 (patch) | |
tree | c4f60b13100e232a1fd1caa62885b307a3939cc1 /drivers/rtc | |
parent | aaa92fae8c9c3cee7f39e64b1a44df3d77320d49 (diff) |
rtc: rtc-sh: switch to using SIMPLE_DEV_PM_OPS
Switch to using the SIMPLE_DEV_PM_OPS macro to declare the driver's
pm_ops. It reduces code size. Also, CONFIG_PM_SLEEP is added to prevent
build warning when CONFIG_PM_SLEEP is not selected.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-sh.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 5f4708522f4d..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,17 +806,15 @@ 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 | }; |