提交 9e3a4afd 编写于 作者: M Mark Brown 提交者: Linus Torvalds

rtc: fix handling of missing tm_year data when reading alarms

When fixing up invalid years rtc_read_alarm() was calling rtc_valid_tm()
as a boolean but rtc_valid_tm() returns zero on success or a negative
number if the time is not valid so the test was inverted.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: NAlessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a564738c
...@@ -271,7 +271,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) ...@@ -271,7 +271,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
dev_dbg(&rtc->dev, "alarm rollover: %s\n", "year"); dev_dbg(&rtc->dev, "alarm rollover: %s\n", "year");
do { do {
alarm->time.tm_year++; alarm->time.tm_year++;
} while (!rtc_valid_tm(&alarm->time)); } while (rtc_valid_tm(&alarm->time) != 0);
break; break;
default: default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册