summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/hctosys.c
diff options
context:
space:
mode:
authorDavid Fries <david@fries.net>2012-10-04 17:14:12 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-06 03:05:04 +0900
commit4c24e29e65843ed912c14cdc293ed922e33efdcc (patch)
tree876a8cac65c0a8200fbed589a1ba3a1c11bf6643 /drivers/rtc/hctosys.c
parentbe8b6d510072461b50958527e7b157f53e5388d7 (diff)
downloadblackbird-obmc-linux-4c24e29e65843ed912c14cdc293ed922e33efdcc.tar.gz
blackbird-obmc-linux-4c24e29e65843ed912c14cdc293ed922e33efdcc.zip
rtc_sysfs_show_hctosys(): display 0 if resume failed
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. [sfr@canb.auug.org.au: fix build] Signed-off-by: David Fries <David@Fries.net> Cc: Matthew Garrett <mjg@redhat.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/hctosys.c')
-rw-r--r--drivers/rtc/hctosys.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/rtc/hctosys.c b/drivers/rtc/hctosys.c
index bc90b091f195..4aa60d74004e 100644
--- a/drivers/rtc/hctosys.c
+++ b/drivers/rtc/hctosys.c
@@ -22,8 +22,6 @@
* the best guess is to add 0.5s.
*/
-int rtc_hctosys_ret = -ENODEV;
-
static int __init rtc_hctosys(void)
{
int err = -ENODEV;
@@ -56,7 +54,7 @@ static int __init rtc_hctosys(void)
rtc_tm_to_time(&tm, &tv.tv_sec);
- do_settimeofday(&tv);
+ err = do_settimeofday(&tv);
dev_info(rtc->dev.parent,
"setting system clock to "
OpenPOWER on IntegriCloud