]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/rtc/interface.c: fix for fix of alarm initialization
authorAles Novak <alnovak@suse.cz>
Thu, 22 May 2014 00:43:46 +0000 (10:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:43:46 +0000 (10:43 +1000)
Seems the previous patch "fix infinite loop in initializing the alarm"
did break the infinite loop in alarm initialization, but not in the right
way. The loop indeed should walk through the not-leap years and stop on
the leap one.

This patch does apply on top of the previous one.

Signed-off-by: Ales Novak <alnovak@suse.cz>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/interface.c

index 13f93fa7fa8080eff2fe608b3216151e6ee09c04..5813fa52c3d43328c80bdb799d38d0b1c68d129d 100644 (file)
@@ -292,8 +292,7 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
                dev_dbg(&rtc->dev, "alarm rollover: %s\n", "year");
                do {
                        alarm->time.tm_year++;
-               } while (alarm->time.tm_mon == 1
-                       && is_leap_year(alarm->time.tm_year + 1900)
+               } while (!is_leap_year(alarm->time.tm_year + 1900)
                        && rtc_valid_tm(&alarm->time) != 0);
                break;