diff options
| author | David Fries <[email protected]> | 2012-10-05 00:14:12 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2012-10-05 18:05:04 +0000 |
| commit | 4c24e29e65843ed912c14cdc293ed922e33efdcc (patch) | |
| tree | 876a8cac65c0a8200fbed589a1ba3a1c11bf6643 /drivers/rtc/rtc-sysfs.c | |
| parent | rtc: rtc-mxc: convert to module_platform_driver (diff) | |
| download | kernel-4c24e29e65843ed912c14cdc293ed922e33efdcc.tar.gz kernel-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.
[[email protected]: fix build]
Signed-off-by: David Fries <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Uwe Kleine-König <[email protected]>
Signed-off-by: Stephen Rothwell <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/rtc/rtc-sysfs.c')
| -rw-r--r-- | drivers/rtc/rtc-sysfs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c index 380083ca572f..b70e2bb63645 100644 --- a/drivers/rtc/rtc-sysfs.c +++ b/drivers/rtc/rtc-sysfs.c @@ -102,6 +102,12 @@ rtc_sysfs_set_max_user_freq(struct device *dev, struct device_attribute *attr, 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) |
