diff mbox series

[2/2] rtc: da9063: switch to rtc_time64_to_tm/rtc_tm_to_time64

Message ID 20190321101557.26857-2-alexandre.belloni@bootlin.com
State Accepted
Headers show
Series [1/2] rtc: da9063: set range | expand

Commit Message

Alexandre Belloni March 21, 2019, 10:15 a.m. UTC
Call the 64bit versions of rtc_tm time conversion now that the range is
enforced by the core.

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

Comments

Steve Twiss March 22, 2019, 3:28 p.m. UTC | #1
On 21 March 2019 10:16, Alexandre Belloni wrote:

> Subject: [PATCH 2/2] rtc: da9063: switch to rtc_time64_to_tm/rtc_tm_to_time64
> 
> Call the 64bit versions of rtc_tm time conversion now that the range is
> enforced by the core.
> 

Thanks Alexandre,

Acked-by: Steve Twiss <stwiss.opensource@diasemi.com>

Regards,
Steve
Wolfram Sang April 1, 2019, 8:43 a.m. UTC | #2
On Thu, Mar 21, 2019 at 11:15:57AM +0100, Alexandre Belloni wrote:
> Call the 64bit versions of rtc_tm time conversion now that the range is
> enforced by the core.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

FWIW, RTC still works on my 32bit system:

Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Steve Twiss April 1, 2019, 12:42 p.m. UTC | #3
Hi,

On 01 April 2019 09:43, Wolfram Sang wrote:

> Subject: Re: [PATCH 2/2] rtc: da9063: switch to
> rtc_time64_to_tm/rtc_tm_to_time64
> 
> On Thu, Mar 21, 2019 at 11:15:57AM +0100, Alexandre Belloni wrote:
> > Call the 64bit versions of rtc_tm time conversion now that the range is
> > enforced by the core.
> >
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> 
> FWIW, RTC still works on my 32bit system:

Thanks!

> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

I've also tested the RTC alarm with this patch.
It seems okay to me, no regressions.

Tested-by: Steve Twiss <stwiss.opensource@diasemi.com>

Regards,
Steve
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c
index b7052156e851..1b792bcea3c7 100644
--- a/drivers/rtc/rtc-da9063.c
+++ b/drivers/rtc/rtc-da9063.c
@@ -239,8 +239,8 @@  static int da9063_rtc_read_time(struct device *dev, struct rtc_time *tm)
 
 	da9063_data_to_tm(data, tm, rtc);
 
-	rtc_tm_to_time(tm, &tm_secs);
-	rtc_tm_to_time(&rtc->alarm_time, &al_secs);
+	tm_secs = rtc_tm_to_time64(tm);
+	al_secs = rtc_tm_to_time64(&rtc->alarm_time);
 
 	/* handle the rtc synchronisation delay */
 	if (rtc->rtc_sync == true && al_secs - tm_secs == 1)