summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-mpc5121.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2020-03-06 08:44:03 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2020-03-16 11:12:10 +0100
commit3d5a49545ac549c122b24c2af730ad00093e5d1f (patch)
treebcee037be37e5124f884e6b677f61944b09256b2 /drivers/rtc/rtc-mpc5121.c
parent3905d1c02dc9dd0b498567f52380bcd9ce6420af (diff)
rtc: mpc5121: switch to rtc_time64_to_tm/rtc_tm_to_time64
Call the 64bit versions of rtc_tm time conversion. Link: https://lore.kernel.org/r/20200306074404.58909-4-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-mpc5121.c')
-rw-r--r--drivers/rtc/rtc-mpc5121.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-mpc5121.c b/drivers/rtc/rtc-mpc5121.c
index 5507f1847f7c..3040844129ce 100644
--- a/drivers/rtc/rtc-mpc5121.c
+++ b/drivers/rtc/rtc-mpc5121.c
@@ -111,7 +111,7 @@ static int mpc5121_rtc_read_time(struct device *dev, struct rtc_time *tm)
*/
now = in_be32(&regs->actual_time) + in_be32(&regs->target_time);
- rtc_time_to_tm(now, tm);
+ rtc_time64_to_tm(now, tm);
/*
* update second minute hour registers
@@ -126,16 +126,14 @@ static int mpc5121_rtc_set_time(struct device *dev, struct rtc_time *tm)
{
struct mpc5121_rtc_data *rtc = dev_get_drvdata(dev);
struct mpc5121_rtc_regs __iomem *regs = rtc->regs;
- int ret;
unsigned long now;
/*
* The actual_time register is read only so we write the offset
* between it and linux time to the target_time register.
*/
- ret = rtc_tm_to_time(tm, &now);
- if (ret == 0)
- out_be32(&regs->target_time, now - in_be32(&regs->actual_time));
+ now = rtc_tm_to_time64(tm);
+ out_be32(&regs->target_time, now - in_be32(&regs->actual_time));
/*
* update second minute hour registers