*/
static struct timespec old_rtc, old_system, old_delta;
-/* Result of the last RTC to system clock attempt. */
-int rtc_hctosys_ret = -ENODEV;
+
static int rtc_suspend(struct device *dev, pm_message_t mesg)
{
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;
if (sleep_time.tv_sec >= 0)
timekeeping_inject_sleeptime(&sleep_time);
- rtc_hctosys_ret = 0;
return 0;
}
* the best guess is to add 0.5s.
*/
+int rtc_hctosys_ret = -ENODEV;
+
static int __init rtc_hctosys(void)
{
int err = -ENODEV;
rtc_tm_to_time(&tm, &tv.tv_sec);
- err = do_settimeofday(&tv);
+ do_settimeofday(&tv);
dev_info(rtc->dev.parent,
"setting system clock to "
return n;
}
-/**
- * rtc_sysfs_show_hctosys - indicate if the given RTC set the system time
- *
- * Returns 1 if the system clock was set by this RTC at the last
- * boot or resume event.
- */
static ssize_t
rtc_sysfs_show_hctosys(struct device *dev, struct device_attribute *attr,
char *buf)
return (!(year % 4) && (year % 100)) || !(year % 400);
}
-#ifdef CONFIG_RTC_HCTOSYS_DEVICE
+#ifdef CONFIG_RTC_HCTOSYS
extern int rtc_hctosys_ret;
#else
#define rtc_hctosys_ret -ENODEV