path: root/drivers/rtc/mc13xxx-rtc.c
diff options
authorSimon Glass <>2015-04-20 12:37:18 -0600
committerSimon Glass <>2015-05-05 20:58:20 -0600
commit9f9276c34cbbf67fd1b3788f0be326b47fc69123 (patch)
tree90e621bf20886ea798cddeae809422c530af476a /drivers/rtc/mc13xxx-rtc.c
parent199e87c340bdd69a89e22f12e1201d67767e91a8 (diff)
dm: rtc: Rename to_tm() to rtc_to_tm() and add error code
Rename this function so that it is clear that it is provided by the RTC. Also return an error when it cannot function as expected. This is unlikely to occur since it works for dates since 1752 and many RTCs do not support such old dates. Still it is better to be accurate. Signed-off-by: Simon Glass <> Acked-by: Heiko Schocher <>
Diffstat (limited to 'drivers/rtc/mc13xxx-rtc.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/mc13xxx-rtc.c b/drivers/rtc/mc13xxx-rtc.c
index 528247ac86..30c4e662dd 100644
--- a/drivers/rtc/mc13xxx-rtc.c
+++ b/drivers/rtc/mc13xxx-rtc.c
@@ -36,7 +36,7 @@ int rtc_get(struct rtc_time *rtc)
tim = day1 * 86400 + time;
- to_tm(tim, rtc);
+ rtc_to_tm(tim, rtc);
rtc->tm_yday = 0;
rtc->tm_isdst = 0;
OpenPOWER on IntegriCloud