diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-04-16 04:34:31 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-04-29 09:53:43 -0400 |
commit | 629d488a3eb660fd511c40b2076cc2bfd4b94f6c (patch) | |
tree | a1e3fd0ebb7822fff6c2111f3741808dcaf0cd77 /drivers/rtc/rtc-imxdi.c | |
parent | d231d32caa901331335b5e35014865e29de2ebbd (diff) |
rtc: imxdi: remove unnecessary check
The RTC core already ensures the alarm is set to a time in the future, it
is not necessary to check again in the driver.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-imxdi.c')
-rw-r--r-- | drivers/rtc/rtc-imxdi.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c index 254bc894105b..2e1f5069c67f 100644 --- a/drivers/rtc/rtc-imxdi.c +++ b/drivers/rtc/rtc-imxdi.c | |||
@@ -641,18 +641,10 @@ static int dryice_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) | |||
641 | { | 641 | { |
642 | struct imxdi_dev *imxdi = dev_get_drvdata(dev); | 642 | struct imxdi_dev *imxdi = dev_get_drvdata(dev); |
643 | unsigned long now; | 643 | unsigned long now; |
644 | unsigned long alarm_time; | ||
645 | int rc; | 644 | int rc; |
646 | 645 | ||
647 | alarm_time = rtc_tm_to_time64(&alarm->time); | ||
648 | |||
649 | /* don't allow setting alarm in the past */ | ||
650 | now = readl(imxdi->ioaddr + DTCMR); | ||
651 | if (alarm_time < now) | ||
652 | return -EINVAL; | ||
653 | |||
654 | /* write the new alarm time */ | 646 | /* write the new alarm time */ |
655 | rc = di_write_wait(imxdi, (u32)alarm_time, DCAMR); | 647 | rc = di_write_wait(imxdi, rtc_tm_to_time64(&alarm->time), DCAMR); |
656 | if (rc) | 648 | if (rc) |
657 | return rc; | 649 | return rc; |
658 | 650 | ||