1
0
Fork 0

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>
hifive-unleashed-5.2
Alexandre Belloni 2019-04-16 10:34:31 +02:00
parent d231d32caa
commit 629d488a3e
1 changed files with 1 additions and 9 deletions

View 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;