projects
/
profile
/
ivi
/
kernel-x86-ivi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29dd0da
)
rtc: rtc-sh: Zero out tm value for invalid rtc states.
author
Paul Mundt
<lethal@linux-sh.org>
Wed, 7 Nov 2007 11:13:24 +0000
(20:13 +0900)
committer
Paul Mundt
<lethal@linux-sh.org>
Wed, 7 Nov 2007 11:13:24 +0000
(20:13 +0900)
Follows the changes of some of the other RTC drivers. If the tm
value is bogus, just zero it out. Adds some sanity for RTC_RD_TIME.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/rtc/rtc-sh.c
patch
|
blob
|
history
diff --git
a/drivers/rtc/rtc-sh.c
b/drivers/rtc/rtc-sh.c
index
61caed5
..
8e8c8b8
100644
(file)
--- a/
drivers/rtc/rtc-sh.c
+++ b/
drivers/rtc/rtc-sh.c
@@
-351,8
+351,10
@@
static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm)
tm->tm_sec, tm->tm_min, tm->tm_hour,
tm->tm_mday, tm->tm_mon + 1, tm->tm_year, tm->tm_wday);
- if (rtc_valid_tm(tm) < 0)
+ if (rtc_valid_tm(tm) < 0)
{
dev_err(dev, "invalid date\n");
+ rtc_time_to_tm(0, tm);
+ }
return 0;
}