rtc, rx8025: fix Coding Style
[oweals/u-boot.git] / drivers / rtc / at91sam9_rtt.c
index 714dd2a34f53268687db5b534febe16d3356e6e8..6f92660ef1da1ec54010e306df8ab95f2348902a 100644 (file)
@@ -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+
  */
 
 /*
 #include <command.h>
 #include <rtc.h>
 #include <asm/io.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_rtt.h>
 #include <asm/arch/at91_gpbr.h>
 
-#if defined(CONFIG_CMD_DATE)
-
 int rtc_get (struct rtc_time *tmp)
 {
        at91_rtt_t *rtt = (at91_rtt_t *) ATMEL_BASE_RTT;
@@ -44,7 +41,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 +51,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);
@@ -80,5 +76,3 @@ void rtc_reset (void)
        while (readl(&rtt->vr) != 0)
                ;
 }
-
-#endif