diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-03-10 18:20:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:28 -0500 |
commit | d0ab4a4d5094e5d17b103dc5073529a04f00a469 (patch) | |
tree | c7f95b41b5802e6204aa2a26f9168668c1a85a25 /include/linux | |
parent | 019b4d123aa7b9fc135b532e021cfde85db7665d (diff) |
rtc/hctosys: only claim the RTC provided the system time if it did
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 reading the time at bootup failed.
Moreover change error handling in rtc_hctosys() to use goto and so reduce
the indention level.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/rtc.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 60f88a7fb13d..14dbc83ded20 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -238,6 +238,12 @@ static inline bool is_leap_year(unsigned int year) | |||
238 | return (!(year % 4) && (year % 100)) || !(year % 400); | 238 | return (!(year % 4) && (year % 100)) || !(year % 400); |
239 | } | 239 | } |
240 | 240 | ||
241 | #ifdef CONFIG_RTC_HCTOSYS | ||
242 | extern int rtc_hctosys_ret; | ||
243 | #else | ||
244 | #define rtc_hctosys_ret -ENODEV | ||
245 | #endif | ||
246 | |||
241 | #endif /* __KERNEL__ */ | 247 | #endif /* __KERNEL__ */ |
242 | 248 | ||
243 | #endif /* _LINUX_RTC_H_ */ | 249 | #endif /* _LINUX_RTC_H_ */ |