On 07/04/2018 11:53 AM, Alexander Graf wrote:
On 07/04/2018 09:36 AM, AKASHI Takahiro wrote:

This patch is missing a patch description. I'm not the maintainer of the rtc 
code base so it's not my call, but I personally just reject all patches with 
empty patch descriptions ;).

And thanks a lot for doing the conversion! I think it's a very good step 
forward.

Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org>
---
...snip...
  /*
- * Reset the RTC. We set the date back to 1970-01-01.
+ * Get the current time from the RTC
   */
-void rtc_reset(void)
+static int pl031_rtc_get(struct udevice *dev, struct rtc_time *tm)
  {
-    RTC_WRITE_REG(RTC_LR, 0x00);
-    if(!pl031_initted)
-        rtc_init();
+    struct pl031_rtc_platdata *pdata = dev_get_platdata(dev);
+    ulong tim;
+
+    if (!tm) {
+        puts("Error getting the date/time\n");
+        return -1;
+    }
+
+    if (!pl031_initted)

In theory with dm you can now have multiple instances of the device, right? So 
we can no longer have a global variable that indicates if a device is 
initialized. Instead, this needs to move into device private data.


I think the initialization code in rtc_init() should be move to the .probe 
callback instead, so there's no need to keep the bool aroun.
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to