rtc: imxdi: remove unnecessary check
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 16 Apr 2019 08:34:31 +0000 (10:34 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 29 Apr 2019 13:53:43 +0000 (15:53 +0200)
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>
drivers/rtc/rtc-imxdi.c

index 254bc894105b24894c915ede9388d77ba4a73663..2e1f5069c67f268ca04d88fa91e9f65e60ae9b30 100644 (file)
@@ -641,18 +641,10 @@ static int dryice_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 {
        struct imxdi_dev *imxdi = dev_get_drvdata(dev);
        unsigned long now;
-       unsigned long alarm_time;
        int rc;
 
-       alarm_time = rtc_tm_to_time64(&alarm->time);
-
-       /* don't allow setting alarm in the past */
-       now = readl(imxdi->ioaddr + DTCMR);
-       if (alarm_time < now)
-               return -EINVAL;
-
        /* write the new alarm time */
-       rc = di_write_wait(imxdi, (u32)alarm_time, DCAMR);
+       rc = di_write_wait(imxdi, rtc_tm_to_time64(&alarm->time), DCAMR);
        if (rc)
                return rc;