All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] rtc: ps3: switch to rtc_time64_to_tm/rtc_tm_to_time64
@ 2019-03-20 12:44 Alexandre Belloni
  2019-03-20 12:44 ` [PATCH 2/4] rtc: ps3: convert to SPDX identifier Alexandre Belloni
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexandre Belloni @ 2019-03-20 12:44 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

Call the 64bit versions of rtc_tm time conversion as the PS3 handles 64bit
values.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-ps3.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/rtc/rtc-ps3.c b/drivers/rtc/rtc-ps3.c
index 347288bff438..bffc5713e16f 100644
--- a/drivers/rtc/rtc-ps3.c
+++ b/drivers/rtc/rtc-ps3.c
@@ -40,16 +40,13 @@ static u64 read_rtc(void)
 
 static int ps3_get_time(struct device *dev, struct rtc_time *tm)
 {
-	rtc_time_to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm);
+	rtc_time64_to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm);
 	return 0;
 }
 
 static int ps3_set_time(struct device *dev, struct rtc_time *tm)
 {
-	unsigned long now;
-
-	rtc_tm_to_time(tm, &now);
-	ps3_os_area_set_rtc_diff(now - read_rtc());
+	ps3_os_area_set_rtc_diff(rtc_tm_to_time64(tm) - read_rtc());
 	return 0;
 }
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-04-01  5:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20 12:44 [PATCH 1/4] rtc: ps3: switch to rtc_time64_to_tm/rtc_tm_to_time64 Alexandre Belloni
2019-03-20 12:44 ` [PATCH 2/4] rtc: ps3: convert to SPDX identifier Alexandre Belloni
2019-03-20 15:56   ` Geert Uytterhoeven
2019-04-01  5:46   ` Mukesh Ojha
2019-03-20 12:44 ` [PATCH 3/4] rtc: ps3: convert to devm_rtc_allocate_device Alexandre Belloni
2019-03-20 12:44 ` [PATCH 4/4] rtc: ps3: set range Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.