summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-zynqmp.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-03-03 16:38:34 -0500
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-03-03 16:38:34 -0500
commit3199fc3d7417282f60387086d26c60d3b32bc4dc (patch)
treea3a753fe7c6635038385e33b6038ef001da04d83 /drivers/rtc/rtc-zynqmp.c
parentb8541798a8a6a288cb2f5c540bf5270e118c0b0c (diff)
rtc: zynqmp: let the core handle range
Let the core handle the RTC range instead of open coding it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-zynqmp.c')
-rw-r--r--drivers/rtc/rtc-zynqmp.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c
index f0dd20785b54..bb950945ec7f 100644
--- a/drivers/rtc/rtc-zynqmp.c
+++ b/drivers/rtc/rtc-zynqmp.c
@@ -49,7 +49,6 @@
49 49
50#define RTC_CALIB_DEF 0x198233 50#define RTC_CALIB_DEF 0x198233
51#define RTC_CALIB_MASK 0x1FFFFF 51#define RTC_CALIB_MASK 0x1FFFFF
52#define RTC_SEC_MAX_VAL 0xFFFFFFFF
53 52
54struct xlnx_rtc_dev { 53struct xlnx_rtc_dev {
55 struct rtc_device *rtc; 54 struct rtc_device *rtc;
@@ -71,9 +70,6 @@ static int xlnx_rtc_set_time(struct device *dev, struct rtc_time *tm)
71 */ 70 */
72 new_time = rtc_tm_to_time64(tm) + 1; 71 new_time = rtc_tm_to_time64(tm) + 1;
73 72
74 if (new_time > RTC_SEC_MAX_VAL)
75 return -EINVAL;
76
77 /* 73 /*
78 * Writing into calibration register will clear the Tick Counter and 74 * Writing into calibration register will clear the Tick Counter and
79 * force the next second to be signaled exactly in 1 second period 75 * force the next second to be signaled exactly in 1 second period
@@ -154,9 +150,6 @@ static int xlnx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
154 150
155 alarm_time = rtc_tm_to_time64(&alrm->time); 151 alarm_time = rtc_tm_to_time64(&alrm->time);
156 152
157 if (alarm_time > RTC_SEC_MAX_VAL)
158 return -EINVAL;
159
160 writel((u32)alarm_time, (xrtcdev->reg_base + RTC_ALRM)); 153 writel((u32)alarm_time, (xrtcdev->reg_base + RTC_ALRM));
161 154
162 xlnx_rtc_alarm_irq_enable(dev, alrm->enabled); 155 xlnx_rtc_alarm_irq_enable(dev, alrm->enabled);
@@ -227,6 +220,7 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
227 return PTR_ERR(xrtcdev->rtc); 220 return PTR_ERR(xrtcdev->rtc);
228 221
229 xrtcdev->rtc->ops = &xlnx_rtc_ops; 222 xrtcdev->rtc->ops = &xlnx_rtc_ops;
223 xrtcdev->rtc->range_max = U32_MAX;
230 224
231 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 225 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
232 226