Commit be8dce96 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: jz4740: 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.
Tested-by: default avatarMathieu Malaterre <malat@debian.org>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent a7ab6bed
...@@ -171,7 +171,7 @@ static int jz4740_rtc_read_time(struct device *dev, struct rtc_time *time) ...@@ -171,7 +171,7 @@ static int jz4740_rtc_read_time(struct device *dev, struct rtc_time *time)
if (timeout == 0) if (timeout == 0)
return -EIO; return -EIO;
rtc_time_to_tm(secs, time); rtc_time64_to_tm(secs, time);
return 0; return 0;
} }
...@@ -196,7 +196,7 @@ static int jz4740_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -196,7 +196,7 @@ static int jz4740_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
alrm->enabled = !!(ctrl & JZ_RTC_CTRL_AE); alrm->enabled = !!(ctrl & JZ_RTC_CTRL_AE);
alrm->pending = !!(ctrl & JZ_RTC_CTRL_AF); alrm->pending = !!(ctrl & JZ_RTC_CTRL_AF);
rtc_time_to_tm(secs, &alrm->time); rtc_time64_to_tm(secs, &alrm->time);
return rtc_valid_tm(&alrm->time); return rtc_valid_tm(&alrm->time);
} }
...@@ -205,9 +205,7 @@ static int jz4740_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -205,9 +205,7 @@ static int jz4740_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{ {
int ret; int ret;
struct jz4740_rtc *rtc = dev_get_drvdata(dev); struct jz4740_rtc *rtc = dev_get_drvdata(dev);
unsigned long secs; uint32_t secs = lower_32_bits(rtc_tm_to_time64(&alrm->time));
rtc_tm_to_time(&alrm->time, &secs);
ret = jz4740_rtc_reg_write(rtc, JZ_REG_RTC_SEC_ALARM, secs); ret = jz4740_rtc_reg_write(rtc, JZ_REG_RTC_SEC_ALARM, secs);
if (!ret) if (!ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment