Merge tag 'u-boot-rockchip-20200501' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / drivers / rtc / m48t35ax.c
index 021b91f7313c7093731a65fa47914bdf52c3d4be..1cc24cccae730d9af18f92d2b25a495293de9e6c 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2001
  * Erik Theisen,  Wave 7 Optics, etheisen@mindspring.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -17,8 +16,6 @@
 #include <rtc.h>
 #include <config.h>
 
-#if defined(CONFIG_CMD_DATE)
-
 static uchar rtc_read  (uchar reg);
 static void  rtc_write (uchar reg, uchar val);
 
@@ -127,10 +124,8 @@ void rtc_reset (void)
 
 static uchar rtc_read (uchar reg)
 {
-       uchar val;
-       val = *(unsigned char *)
+       return *(unsigned char *)
                ((CONFIG_SYS_NVRAM_BASE_ADDR + CONFIG_SYS_NVRAM_SIZE - 8) + reg);
-       return val;
 }
 
 static void rtc_write (uchar reg, uchar val)
@@ -138,5 +133,3 @@ static void rtc_write (uchar reg, uchar val)
        *(unsigned char *)
                ((CONFIG_SYS_NVRAM_BASE_ADDR + CONFIG_SYS_NVRAM_SIZE - 8) + reg) = val;
 }
-
-#endif