diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-10-02 00:05:25 +0200 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-10-03 11:07:24 +0200 |
commit | 959e8b77bf9232a1956e03325837047b110553b2 (patch) | |
tree | 0446ecc9d99456d6d5f6b80a9a9b580dbc6382a2 /drivers/rtc/rtc-mv.c | |
parent | 89e27ce49846a7dedbcaefccbb6cc885c5baae14 (diff) | |
download | blackbird-obmc-linux-959e8b77bf9232a1956e03325837047b110553b2.tar.gz blackbird-obmc-linux-959e8b77bf9232a1956e03325837047b110553b2.zip |
rtc: mv: let the core handle invalid alarms
Instead of lying to the core when the alarm is invalid, let it handle that
by returning the error.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com> (on Armada 375 DB)
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-mv.c')
-rw-r--r-- | drivers/rtc/rtc-mv.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c index 4b198b3778d3..e7f14bd12fe3 100644 --- a/drivers/rtc/rtc-mv.c +++ b/drivers/rtc/rtc-mv.c @@ -125,13 +125,9 @@ static int mv_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) /* hw counts from year 2000, but tm_year is relative to 1900 */ alm->time.tm_year = bcd2bin(year) + 100; - if (rtc_valid_tm(&alm->time) < 0) { - dev_err(dev, "retrieved alarm date/time is not valid.\n"); - rtc_time_to_tm(0, &alm->time); - } - alm->enabled = !!readl(ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS); - return 0; + + return rtc_valid_tm(&alm->time); } static int mv_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) |