The rtc chip doesn't support triggering on month and year. So just don't
assign the respective fields in .read_alarm and let the rtc core
interpret this accordingly.

Signed-off-by: Uwe Kleine-König <u...@kleine-koenig.org>
---
 drivers/rtc/rtc-isl12057.c | 30 ------------------------------
 1 file changed, 30 deletions(-)

diff --git a/drivers/rtc/rtc-isl12057.c b/drivers/rtc/rtc-isl12057.c
index 54328d4ac0d3..e0245fc6205e 100644
--- a/drivers/rtc/rtc-isl12057.c
+++ b/drivers/rtc/rtc-isl12057.c
@@ -264,36 +264,6 @@ static int isl12057_rtc_read_alarm(struct device *dev, 
struct rtc_wkalrm *alarm)
        alarm_tm->tm_min  = bcd2bin(regs[1] & 0x7f);
        alarm_tm->tm_hour = bcd2bin(regs[2] & 0x3f);
        alarm_tm->tm_mday = bcd2bin(regs[3] & 0x3f);
-       alarm_tm->tm_wday = -1;
-
-       /*
-        * The alarm section does not store year/month. We use the ones in rtc
-        * section as a basis and increment month and then year if needed to get
-        * alarm after current time.
-        */
-       ret = _isl12057_rtc_read_time(dev, &rtc_tm);
-       if (ret)
-               goto err_unlock;
-
-       alarm_tm->tm_year = rtc_tm.tm_year;
-       alarm_tm->tm_mon = rtc_tm.tm_mon;
-
-       ret = rtc_tm_to_time(&rtc_tm, &rtc_secs);
-       if (ret)
-               goto err_unlock;
-
-       ret = rtc_tm_to_time(alarm_tm, &alarm_secs);
-       if (ret)
-               goto err_unlock;
-
-       if (alarm_secs < rtc_secs) {
-               if (alarm_tm->tm_mon == 11) {
-                       alarm_tm->tm_mon = 0;
-                       alarm_tm->tm_year += 1;
-               } else {
-                       alarm_tm->tm_mon += 1;
-               }
-       }
 
        ret = regmap_read(data->regmap, ISL12057_REG_INT, &ir);
        if (ret) {
-- 
2.8.1

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups 
"rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rtc-linux+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to