diff options
Diffstat (limited to 'drivers/rtc/class.c')
-rw-r--r-- | drivers/rtc/class.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 37b1d82fda08..f8a0aab218cb 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
@@ -31,8 +31,12 @@ static void rtc_device_release(struct device *dev) | |||
31 | kfree(rtc); | 31 | kfree(rtc); |
32 | } | 32 | } |
33 | 33 | ||
34 | #if defined(CONFIG_PM) && defined(CONFIG_RTC_HCTOSYS_DEVICE) | 34 | #ifdef CONFIG_RTC_HCTOSYS_DEVICE |
35 | /* Result of the last RTC to system clock attempt. */ | ||
36 | int rtc_hctosys_ret = -ENODEV; | ||
37 | #endif | ||
35 | 38 | ||
39 | #if defined(CONFIG_PM) && defined(CONFIG_RTC_HCTOSYS_DEVICE) | ||
36 | /* | 40 | /* |
37 | * On suspend(), measure the delta between one RTC and the | 41 | * On suspend(), measure the delta between one RTC and the |
38 | * system's wall clock; restore it on resume(). | 42 | * system's wall clock; restore it on resume(). |
@@ -84,6 +88,7 @@ static int rtc_resume(struct device *dev) | |||
84 | struct timespec new_system, new_rtc; | 88 | struct timespec new_system, new_rtc; |
85 | struct timespec sleep_time; | 89 | struct timespec sleep_time; |
86 | 90 | ||
91 | rtc_hctosys_ret = -ENODEV; | ||
87 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) | 92 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) |
88 | return 0; | 93 | return 0; |
89 | 94 | ||
@@ -117,6 +122,7 @@ static int rtc_resume(struct device *dev) | |||
117 | 122 | ||
118 | if (sleep_time.tv_sec >= 0) | 123 | if (sleep_time.tv_sec >= 0) |
119 | timekeeping_inject_sleeptime(&sleep_time); | 124 | timekeeping_inject_sleeptime(&sleep_time); |
125 | rtc_hctosys_ret = 0; | ||
120 | return 0; | 126 | return 0; |
121 | } | 127 | } |
122 | 128 | ||