Commit 408929be authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Linus Torvalds

rtc: m41t80: do not use rtc_valid_tm in m41t80_rtc_read_alarm

Commit b485fe5e ("rtc/m41t80: use rtc_valid_tm() to check returned tm")
added rtc_valid_tm to m41t80_rtc_read_alarm() but it was wrong while the
t->time does not contain complete date/time.

This patch also fixes a warning:
warning: passing argument 1 of 'rtc_valid_tm' from incompatible pointer type
Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ee3aebdd
...@@ -364,7 +364,7 @@ static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t) ...@@ -364,7 +364,7 @@ static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t)
t->time.tm_isdst = -1; t->time.tm_isdst = -1;
t->enabled = !!(reg[M41T80_REG_ALARM_MON] & M41T80_ALMON_AFE); t->enabled = !!(reg[M41T80_REG_ALARM_MON] & M41T80_ALMON_AFE);
t->pending = !!(reg[M41T80_REG_FLAGS] & M41T80_FLAGS_AF); t->pending = !!(reg[M41T80_REG_FLAGS] & M41T80_FLAGS_AF);
return rtc_valid_tm(t); return 0;
} }
static struct rtc_class_ops m41t80_rtc_ops = { static struct rtc_class_ops m41t80_rtc_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment