]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rtc: st-lpc: remove unnecessary check
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 30 Apr 2019 20:18:34 +0000 (22:18 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 23 May 2019 15:53:05 +0000 (17: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-st-lpc.c

index bee75ca7ff79b10872b690affc6a9d388aa25844..ce2dae6e2a245d34fe2da57afce19faec56f5d43 100644 (file)
@@ -166,10 +166,6 @@ static int st_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *t)
        now_secs = rtc_tm_to_time64(&now);
        alarm_secs = rtc_tm_to_time64(&t->time);
 
-       /* Invalid alarm time */
-       if (now_secs > alarm_secs)
-               return -EINVAL;
-
        memcpy(&rtc->alarm, t, sizeof(struct rtc_wkalrm));
 
        /* Now many secs to fire */