]> git.sur5r.net Git - u-boot/blobdiff - drivers/rtc/bfin_rtc.c
dm: rtc: Rename to_tm() to rtc_to_tm() and add error code
[u-boot] / drivers / rtc / bfin_rtc.c
index 5de695384f1588dfa4e49dcd4ea90339ffa46c0a..6cb1ebac74c09996fc78f7a1d15349285402f69d 100644 (file)
@@ -27,7 +27,7 @@
 #define NUM_SECS_IN_DAY   DAYS_TO_SECS(1)
 
 /* Enable the RTC prescaler enable register */
-static void rtc_init(void)
+void rtc_init(void)
 {
        if (!(bfin_read_RTC_PREN() & 0x1))
                bfin_write_RTC_PREN(0x1);
@@ -68,7 +68,7 @@ int rtc_set(struct rtc_time *tmp)
 
        /* Calculate number of seconds this incoming time represents */
        remain = mktime(tmp->tm_year, tmp->tm_mon, tmp->tm_mday,
-                       tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+                       tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
 
        /* Figure out how many days since epoch */
        days = remain / NUM_SECS_IN_DAY;
@@ -114,7 +114,7 @@ int rtc_get(struct rtc_time *tmp)
 
        /* Calculate the total number of seconds since epoch */
        time_in_sec = (tm_sec) + MIN_TO_SECS(tm_min) + HRS_TO_SECS(tm_hr) + DAYS_TO_SECS(tm_day);
-       to_tm(time_in_sec, tmp);
+       rtc_to_tm(time_in_sec, tmp);
 
        return 0;
 }