rtc: pt7c4338: Add driver model support
[oweals/u-boot.git] / drivers / rtc / i2c_rtc_emul.c
index 0e06c97367a2e9cd88e82fd7b321da1c72279e97..d4b33e59d6966835b2e4a6212eb6eb472d43ac66 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+
  */
 
 /*
@@ -28,8 +27,6 @@
 #define debug_buffer(x, ...)
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /**
  * struct sandbox_i2c_rtc_plat_data - platform data for the RTC
  *
@@ -99,7 +96,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)