Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
[oweals/u-boot.git] / drivers / rtc / i2c_rtc_emul.c
index 0e06c97367a2e9cd88e82fd7b321da1c72279e97..a010af411bbd5f1023aede023cd52d78495d7425 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Simulate an I2C real time clock
  *
  * Copyright (c) 2015 Google, Inc
  * Written by Simon Glass <sjg@chromium.org>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -17,6 +16,7 @@
 #include <common.h>
 #include <dm.h>
 #include <i2c.h>
+#include <log.h>
 #include <os.h>
 #include <rtc.h>
 #include <asm/rtc.h>
@@ -28,8 +28,6 @@
 #define debug_buffer(x, ...)
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /**
  * struct sandbox_i2c_rtc_plat_data - platform data for the RTC
  *
@@ -99,7 +97,9 @@ static int sandbox_i2c_rtc_get(struct udevice *dev, struct rtc_time *time)
                now = plat->base_time;
        }
 
-       return rtc_to_tm(now + plat->offset, time);
+       rtc_to_tm(now + plat->offset, time);
+
+       return 0;
 }
 
 static int sandbox_i2c_rtc_set(struct udevice *dev, const struct rtc_time *time)