|
@@ -31,8 +31,12 @@ static void rtc_device_release(struct device *dev)
|
|
|
kfree(rtc);
|
|
|
}
|
|
|
|
|
|
-#if defined(CONFIG_PM) && defined(CONFIG_RTC_HCTOSYS_DEVICE)
|
|
|
+#ifdef CONFIG_RTC_HCTOSYS_DEVICE
|
|
|
+/* Result of the last RTC to system clock attempt. */
|
|
|
+int rtc_hctosys_ret = -ENODEV;
|
|
|
+#endif
|
|
|
|
|
|
+#if defined(CONFIG_PM) && defined(CONFIG_RTC_HCTOSYS_DEVICE)
|
|
|
/*
|
|
|
* On suspend(), measure the delta between one RTC and the
|
|
|
* system's wall clock; restore it on resume().
|
|
@@ -84,6 +88,7 @@ static int rtc_resume(struct device *dev)
|
|
|
struct timespec new_system, new_rtc;
|
|
|
struct timespec sleep_time;
|
|
|
|
|
|
+ rtc_hctosys_ret = -ENODEV;
|
|
|
if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0)
|
|
|
return 0;
|
|
|
|
|
@@ -117,6 +122,7 @@ static int rtc_resume(struct device *dev)
|
|
|
|
|
|
if (sleep_time.tv_sec >= 0)
|
|
|
timekeeping_inject_sleeptime(&sleep_time);
|
|
|
+ rtc_hctosys_ret = 0;
|
|
|
return 0;
|
|
|
}
|
|
|
|