rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 22 Mar 2019 07:22:54 +0000 (08:22 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 4 Apr 2019 08:07:10 +0000 (10:07 +0200)
Call the 64bit versions of rtc_tm time conversion as the hypervisor handles
64bit values.

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-sun4v.c

index 11bc562eba5dfb7d9aa749ff9e951397b9d6c7a8..378081fffa91522453d2059891eb1c7fd8c1fe39 100644 (file)
@@ -39,7 +39,7 @@ retry:
 
 static int sun4v_read_time(struct device *dev, struct rtc_time *tm)
 {
-       rtc_time_to_tm(hypervisor_get_time(), tm);
+       rtc_time64_to_tm(hypervisor_get_time(), tm);
        return 0;
 }
 
@@ -66,14 +66,7 @@ retry:
 
 static int sun4v_set_time(struct device *dev, struct rtc_time *tm)
 {
-       unsigned long secs;
-       int err;
-
-       err = rtc_tm_to_time(tm, &secs);
-       if (err)
-               return err;
-
-       return hypervisor_set_time(secs);
+       return hypervisor_set_time(rtc_tm_to_time64(tm));
 }
 
 static const struct rtc_class_ops sun4v_rtc_ops = {