summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-mxc_v2.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-05-19 10:04:46 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-05-19 10:47:46 +0200
commit95fbfa14b431d4d7213b8e0e167563f7a11dd5e7 (patch)
treec7dfe1645220153b096c0a42cb625828674e26fa /drivers/rtc/rtc-mxc_v2.c
parent5490a1e018a4b447c1fdb49ec274a620e60a4d42 (diff)
rtc: mxc_v2: let the core handle rtc range
This RTC is a 32-bit second counter. This also solves an issue where mxc_rtc_set_alarm() can return with the lock taken. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-mxc_v2.c')
-rw-r--r--drivers/rtc/rtc-mxc_v2.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c
index 4cc121a41fe0..24ca74ca632a 100644
--- a/drivers/rtc/rtc-mxc_v2.c
+++ b/drivers/rtc/rtc-mxc_v2.c
@@ -165,11 +165,6 @@ static int mxc_rtc_set_time(struct device *dev, struct rtc_time *tm)
time64_t time = rtc_tm_to_time64(tm);
int ret;
- if (time > U32_MAX) {
- dev_err(dev, "RTC exceeded by %llus\n", time - U32_MAX);
- return -EINVAL;
- }
-
ret = mxc_rtc_lock(pdata);
if (ret)
return ret;
@@ -248,11 +243,6 @@ static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
if (ret)
return ret;
- if (time > U32_MAX) {
- dev_err(dev, "Hopefully I am out of service by then :-(\n");
- return -EINVAL;
- }
-
writel((u32)time, pdata->ioaddr + SRTC_LPSAR);
/* clear alarm interrupt status bit */
@@ -348,6 +338,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
return PTR_ERR(pdata->rtc);
pdata->rtc->ops = &mxc_rtc_ops;
+ pdata->rtc->range_max = U32_MAX;
clk_disable(pdata->clk);
platform_set_drvdata(pdev, pdata);