rtc: ds1305: switch to rtc_tm_to_time64
Call the 64bit version of rtc_tm to time conversion. Link: https://lore.kernel.org/r/20200306073459.57197-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
9869a93c82
commit
f2adcb9c3a
@ -325,17 +325,13 @@ static int ds1305_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
|
|||||||
u8 buf[1 + DS1305_ALM_LEN];
|
u8 buf[1 + DS1305_ALM_LEN];
|
||||||
|
|
||||||
/* convert desired alarm to time_t */
|
/* convert desired alarm to time_t */
|
||||||
status = rtc_tm_to_time(&alm->time, &later);
|
later = rtc_tm_to_time64(&alm->time);
|
||||||
if (status < 0)
|
|
||||||
return status;
|
|
||||||
|
|
||||||
/* Read current time as time_t */
|
/* Read current time as time_t */
|
||||||
status = ds1305_get_time(dev, &tm);
|
status = ds1305_get_time(dev, &tm);
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
return status;
|
return status;
|
||||||
status = rtc_tm_to_time(&tm, &now);
|
now = rtc_tm_to_time64(&tm);
|
||||||
if (status < 0)
|
|
||||||
return status;
|
|
||||||
|
|
||||||
/* make sure alarm fires within the next 24 hours */
|
/* make sure alarm fires within the next 24 hours */
|
||||||
if (later <= now)
|
if (later <= now)
|
||||||
|
Loading…
Reference in New Issue
Block a user