X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Frtc%2Fat91sam9_rtt.c;h=da5bb3e2f78785d2fa0deba9c9ca6e9ce900682a;hb=0298d2037542b4f56124d29995dc7435c6af8bd1;hp=714dd2a34f53268687db5b534febe16d3356e6e8;hpb=3be2bdf5dc69b3142c1162a59bc67191c9077567;p=oweals%2Fu-boot.git diff --git a/drivers/rtc/at91sam9_rtt.c b/drivers/rtc/at91sam9_rtt.c index 714dd2a34f..da5bb3e2f7 100644 --- a/drivers/rtc/at91sam9_rtt.c +++ b/drivers/rtc/at91sam9_rtt.c @@ -1,8 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2010 * Reinhard Meyer, reinhard.meyer@emk-elektronik.de - * - * SPDX-License-Identifier: GPL-2.0+ */ /* @@ -23,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -44,7 +43,7 @@ int rtc_get (struct rtc_time *tmp) } while (tim!=tim2); off = readl(&gpbr->reg[AT91_GPBR_INDEX_TIMEOFF]); /* off==0 means time is invalid, but we ignore that */ - to_tm (tim+off, tmp); + rtc_to_tm(tim+off, tmp); return 0; } @@ -54,8 +53,7 @@ int rtc_set (struct rtc_time *tmp) at91_gpbr_t *gpbr = (at91_gpbr_t *) ATMEL_BASE_GPBR; ulong tim; - tim = mktime (tmp->tm_year, tmp->tm_mon, tmp->tm_mday, - tmp->tm_hour, tmp->tm_min, tmp->tm_sec); + tim = rtc_mktime(tmp); /* clear alarm, set prescaler to 32768, clear counter */ writel(32768+AT91_RTT_RTTRST, &rtt->mr);