From 2237ba05b6847ead773ce454566a177c84cefc4a Mon Sep 17 00:00:00 2001 From: David Fries Date: Fri, 28 Sep 2012 10:20:36 +1000 Subject: [PATCH] rtc_sysfs_show_hctosys(): display 0 if resume failed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Without this patch /sys/class/rtc/$CONFIG_RTC_HCTOSYS_DEVICE/hctosys contains a 1 (meaning "This rtc was used to initialize the system clock") even if setting the time by do_settimeofday() at bootup failed. The RTC can also be used to set the clock on resume, if it did 1, otherwise 0. Previously there was no indication if the RTC was used to set the clock in resume. This uses only CONFIG_RTC_HCTOSYS_DEVICE for conditional compilation instead of it and CONFIG_RTC_HCTOSYS to be more consistent. rtc_hctosys_ret was moved to class.c so class.c no longer depends on hctosys.c. Signed-off-by: David Fries Cc: Matthew Garrett Cc: Alessandro Zummo Cc: Uwe Kleine-König Signed-off-by: Andrew Morton --- drivers/rtc/class.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index f8a0aab218cb..528c99bb294a 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -43,7 +43,8 @@ int rtc_hctosys_ret = -ENODEV; */ 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) { -- 2.39.5