projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d6c7428
)
rtc/m41t80: use rtc_valid_tm() to check returned tm
author
Wan ZongShun
<
[email protected]
>
Wed, 11 Aug 2010 01:02:15 +0000
(18:02 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 11 Aug 2010 15:59:07 +0000
(08:59 -0700)
Use rtc_valid_tm() to check returned struct rtc_time *tm - it can avoid
returning wrong tm value.
Signed-off-by: Wan ZongShun <
[email protected]
>
Cc: Alessandro Zummo <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/rtc/rtc-m41t80.c
patch
|
blob
|
history
diff --git
a/drivers/rtc/rtc-m41t80.c
b/drivers/rtc/rtc-m41t80.c
index 6dc4e6241418ac601a40abf5dfb0744401d44d5d..66377f3e28b851eaa908c6057a9646a639e9c229 100644
(file)
--- a/
drivers/rtc/rtc-m41t80.c
+++ b/
drivers/rtc/rtc-m41t80.c
@@
-121,7
+121,7
@@
static int m41t80_get_datetime(struct i2c_client *client,
/* assume 20YY not 19YY, and ignore the Century Bit */
tm->tm_year = bcd2bin(buf[M41T80_REG_YEAR]) + 100;
- return
0
;
+ return
rtc_valid_tm(tm)
;
}
/* Sets the given date and time to the real time clock. */
@@
-364,7
+364,7
@@
static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t)
t->time.tm_isdst = -1;
t->enabled = !!(reg[M41T80_REG_ALARM_MON] & M41T80_ALMON_AFE);
t->pending = !!(reg[M41T80_REG_FLAGS] & M41T80_FLAGS_AF);
- return
0
;
+ return
rtc_valid_tm(t)
;
}
static struct rtc_class_ops m41t80_rtc_ops = {