Commit c814dc13 authored by Wan ZongShun's avatar Wan ZongShun Committed by Linus Torvalds

rtc/max6900: use rtc_valid_tm() to check returning tm

Use rtc_valid_tm() to check returning tm for max6900, it can avoid
returning wrong tm value.
Signed-off-by: default avatarWan ZongShun <mcuos.com@gmail.com>
Acked-by: default avatarDale Farnsworth <dale@farnsworth.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b485fe5e
......@@ -159,7 +159,7 @@ static int max6900_i2c_read_time(struct i2c_client *client, struct rtc_time *tm)
bcd2bin(regs[MAX6900_REG_CENTURY]) * 100 - 1900;
tm->tm_wday = bcd2bin(regs[MAX6900_REG_DW]);
return 0;
return rtc_valid_tm(tm);
}
static int max6900_i2c_clear_write_protect(struct i2c_client *client)
......
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