]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rtc_sysfs_show_hctosys(): display 0 if resume failed
authorDavid Fries <david@fries.net>
Fri, 28 Sep 2012 00:20:36 +0000 (10:20 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 2 Oct 2012 06:00:25 +0000 (16:00 +1000)
commita033eb3ddc2e21e1f0cc4a9dadc1a244398bad6c
tree0e0e37e270414f89f2bf47d6320fe5b1a7854d73
parent85e8b72229e068c8953831a4f26e2d48f9b8bdb3
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.

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: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/class.c
drivers/rtc/hctosys.c
drivers/rtc/rtc-sysfs.c
include/linux/rtc.h