X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Frtc%2Fmcfrtc.c;h=979c466514e720ba7f8ab6deef225bf1114e238d;hb=158947d276c96a49e0a99a97a61605be1bb5eb7a;hp=d235d10f28fceca8c767b2a848bdf211339fde30;hpb=4b7a6dd89633d60dc4b58476d5ce48247f82a3ca;p=u-boot diff --git a/drivers/rtc/mcfrtc.c b/drivers/rtc/mcfrtc.c index d235d10f28..979c466514 100644 --- a/drivers/rtc/mcfrtc.c +++ b/drivers/rtc/mcfrtc.c @@ -23,7 +23,7 @@ #include -#if defined(CONFIG_MCFRTC) && defined(CONFIG_CMD_DATE) +#if defined(CONFIG_CMD_DATE) #include #include @@ -32,7 +32,7 @@ #undef RTC_DEBUG -#ifndef CFG_MCFRTC_BASE +#ifndef CONFIG_SYS_MCFRTC_BASE #error RTC_BASE is not defined! #endif @@ -41,7 +41,7 @@ int rtc_get(struct rtc_time *tmp) { - volatile rtc_t *rtc = (rtc_t *) (CFG_MCFRTC_BASE); + volatile rtc_t *rtc = (rtc_t *) (CONFIG_SYS_MCFRTC_BASE); int rtc_days, rtc_hrs, rtc_mins; int tim; @@ -68,9 +68,9 @@ int rtc_get(struct rtc_time *tmp) return 0; } -void rtc_set(struct rtc_time *tmp) +int rtc_set(struct rtc_time *tmp) { - volatile rtc_t *rtc = (rtc_t *) (CFG_MCFRTC_BASE); + volatile rtc_t *rtc = (rtc_t *) (CONFIG_SYS_MCFRTC_BASE); static int month_days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 @@ -106,11 +106,13 @@ void rtc_set(struct rtc_time *tmp) rtc->days = days; rtc->hourmin = (tmp->tm_hour << 8) | tmp->tm_min; rtc->seconds = tmp->tm_sec; + + return 0; } void rtc_reset(void) { - volatile rtc_t *rtc = (rtc_t *) (CFG_MCFRTC_BASE); + volatile rtc_t *rtc = (rtc_t *) (CONFIG_SYS_MCFRTC_BASE); if ((rtc->cr & RTC_CR_EN) == 0) { printf("real-time-clock was stopped. Now starting...\n");