diff options
author | Feng Tang <feng.tang@intel.com> | 2013-01-15 11:09:48 -0500 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2013-01-15 21:16:08 -0500 |
commit | 9ecf37eb7a81e3295a1b274eafb6f83d7d2cabf0 (patch) | |
tree | c1753603b4d286a5cb45570ebc52d69caea51bad | |
parent | 31ade30692dc9680bfc95700d794818fa3f754ac (diff) |
rtc: Skip the suspend/resume handling if persistent clock exist
All the RTC suspend and resume functions are to compensate the
sleep time, but this is already done in timekeeping.c if persistent
clock exist.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r-- | drivers/rtc/class.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index f8a0aab218cb..c01773f56435 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
@@ -50,6 +50,10 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg) | |||
50 | struct rtc_device *rtc = to_rtc_device(dev); | 50 | struct rtc_device *rtc = to_rtc_device(dev); |
51 | struct rtc_time tm; | 51 | struct rtc_time tm; |
52 | struct timespec delta, delta_delta; | 52 | struct timespec delta, delta_delta; |
53 | |||
54 | if (has_persistent_clock()) | ||
55 | return 0; | ||
56 | |||
53 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) | 57 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) |
54 | return 0; | 58 | return 0; |
55 | 59 | ||
@@ -88,6 +92,9 @@ static int rtc_resume(struct device *dev) | |||
88 | struct timespec new_system, new_rtc; | 92 | struct timespec new_system, new_rtc; |
89 | struct timespec sleep_time; | 93 | struct timespec sleep_time; |
90 | 94 | ||
95 | if (has_persistent_clock()) | ||
96 | return 0; | ||
97 | |||
91 | rtc_hctosys_ret = -ENODEV; | 98 | rtc_hctosys_ret = -ENODEV; |
92 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) | 99 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) |
93 | return 0; | 100 | return 0; |