Commit 61c9fbff authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: pl031: remove useless invalid alarm handling

The core will never pass an invalid alarm to .set_alarm, it is not
necessary to check for its validity.
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20200306005809.38530-1-alexandre.belloni@bootlin.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 7098f536
...@@ -210,9 +210,6 @@ static int pl031_stv2_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) ...@@ -210,9 +210,6 @@ static int pl031_stv2_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
unsigned long bcd_year; unsigned long bcd_year;
int ret; int ret;
/* At the moment, we can only deal with non-wildcarded alarm times. */
ret = rtc_valid_tm(&alarm->time);
if (ret == 0) {
ret = pl031_stv2_tm_to_time(dev, &alarm->time, ret = pl031_stv2_tm_to_time(dev, &alarm->time,
&time, &bcd_year); &time, &bcd_year);
if (ret == 0) { if (ret == 0) {
...@@ -221,7 +218,6 @@ static int pl031_stv2_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) ...@@ -221,7 +218,6 @@ static int pl031_stv2_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
pl031_alarm_irq_enable(dev, alarm->enabled); pl031_alarm_irq_enable(dev, alarm->enabled);
} }
}
return ret; return ret;
} }
...@@ -285,15 +281,11 @@ static int pl031_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) ...@@ -285,15 +281,11 @@ static int pl031_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
unsigned long time; unsigned long time;
int ret; int ret;
/* At the moment, we can only deal with non-wildcarded alarm times. */
ret = rtc_valid_tm(&alarm->time);
if (ret == 0) {
ret = rtc_tm_to_time(&alarm->time, &time); ret = rtc_tm_to_time(&alarm->time, &time);
if (ret == 0) { if (ret == 0) {
writel(time, ldata->base + RTC_MR); writel(time, ldata->base + RTC_MR);
pl031_alarm_irq_enable(dev, alarm->enabled); pl031_alarm_irq_enable(dev, alarm->enabled);
} }
}
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment