Commit f04dd349 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: lpc32xx: 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.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent ba4a84f5
...@@ -66,7 +66,7 @@ static int lpc32xx_rtc_read_time(struct device *dev, struct rtc_time *time) ...@@ -66,7 +66,7 @@ static int lpc32xx_rtc_read_time(struct device *dev, struct rtc_time *time)
struct lpc32xx_rtc *rtc = dev_get_drvdata(dev); struct lpc32xx_rtc *rtc = dev_get_drvdata(dev);
elapsed_sec = rtc_readl(rtc, LPC32XX_RTC_UCOUNT); elapsed_sec = rtc_readl(rtc, LPC32XX_RTC_UCOUNT);
rtc_time_to_tm(elapsed_sec, time); rtc_time64_to_tm(elapsed_sec, time);
return 0; return 0;
} }
...@@ -95,7 +95,7 @@ static int lpc32xx_rtc_read_alarm(struct device *dev, ...@@ -95,7 +95,7 @@ static int lpc32xx_rtc_read_alarm(struct device *dev,
{ {
struct lpc32xx_rtc *rtc = dev_get_drvdata(dev); struct lpc32xx_rtc *rtc = dev_get_drvdata(dev);
rtc_time_to_tm(rtc_readl(rtc, LPC32XX_RTC_MATCH0), &wkalrm->time); rtc_time64_to_tm(rtc_readl(rtc, LPC32XX_RTC_MATCH0), &wkalrm->time);
wkalrm->enabled = rtc->alarm_enabled; wkalrm->enabled = rtc->alarm_enabled;
wkalrm->pending = !!(rtc_readl(rtc, LPC32XX_RTC_INTSTAT) & wkalrm->pending = !!(rtc_readl(rtc, LPC32XX_RTC_INTSTAT) &
LPC32XX_RTC_INTSTAT_MATCH0); LPC32XX_RTC_INTSTAT_MATCH0);
...@@ -109,13 +109,8 @@ static int lpc32xx_rtc_set_alarm(struct device *dev, ...@@ -109,13 +109,8 @@ static int lpc32xx_rtc_set_alarm(struct device *dev,
struct lpc32xx_rtc *rtc = dev_get_drvdata(dev); struct lpc32xx_rtc *rtc = dev_get_drvdata(dev);
unsigned long alarmsecs; unsigned long alarmsecs;
u32 tmp; u32 tmp;
int ret;
ret = rtc_tm_to_time(&wkalrm->time, &alarmsecs); alarmsecs = rtc_tm_to_time64(&wkalrm->time);
if (ret < 0) {
dev_warn(dev, "Failed to convert time: %d\n", ret);
return ret;
}
spin_lock_irq(&rtc->lock); spin_lock_irq(&rtc->lock);
......
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