CFI: Fix AMD Legacy sector protect
[oweals/u-boot.git] / drivers / rtc / rs5c372.c
index 3d1346eaa7a4e44113089f5ee90b3b91acd9e1fb..38db19929f66726b60e001f4d448a82acaef5238 100644 (file)
@@ -34,7 +34,7 @@
 #include <rtc.h>
 #include <i2c.h>
 
-#if defined(CONFIG_RTC_RS5C372A) && defined(CONFIG_CMD_DATE)
+#if defined(CONFIG_CMD_DATE)
 /*
  * Reads are always done starting with register 15, which requires some
  * jumping-through-hoops to access the data correctly.
@@ -166,7 +166,7 @@ rs5c372_convert_to_time(struct rtc_time *dt, unsigned char *buf)
 /*
  * Get the current time from the RTC
  */
-void
+int
 rtc_get (struct rtc_time *tmp)
 {
        unsigned char buf[RS5C372_RAM_SIZE];
@@ -176,7 +176,7 @@ rtc_get (struct rtc_time *tmp)
                rs5c372_enable();
 
        if (!setup_done)
-               return;
+               return -1;
 
        memset(buf, 0, sizeof(buf));
 
@@ -184,12 +184,12 @@ rtc_get (struct rtc_time *tmp)
        ret = rs5c372_readram(buf, RS5C372_RAM_SIZE);
        if (ret != 0) {
                printf("%s: failed\n", __FUNCTION__);
-               return;
+               return -1;
        }
 
        rs5c372_convert_to_time(tmp, buf);
 
-       return;
+       return 0;
 }
 
 /*