aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-10-01 18:05:25 -0400
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-10-03 05:07:24 -0400
commit959e8b77bf9232a1956e03325837047b110553b2 (patch)
tree0446ecc9d99456d6d5f6b80a9a9b580dbc6382a2
parent89e27ce49846a7dedbcaefccbb6cc885c5baae14 (diff)
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>
-rw-r--r--drivers/rtc/rtc-mv.c8
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)
125 /* hw counts from year 2000, but tm_year is relative to 1900 */ 125 /* hw counts from year 2000, but tm_year is relative to 1900 */
126 alm->time.tm_year = bcd2bin(year) + 100; 126 alm->time.tm_year = bcd2bin(year) + 100;
127 127
128 if (rtc_valid_tm(&alm->time) < 0) {
129 dev_err(dev, "retrieved alarm date/time is not valid.\n");
130 rtc_time_to_tm(0, &alm->time);
131 }
132
133 alm->enabled = !!readl(ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS); 128 alm->enabled = !!readl(ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
134 return 0; 129
130 return rtc_valid_tm(&alm->time);
135} 131}
136 132
137static int mv_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) 133static int mv_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)