Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0ac554b9be9fd340aa59e0d6a311986afcea40cf
Commit:     0ac554b9be9fd340aa59e0d6a311986afcea40cf
Parent:     29dd0dae507f73f305aaea765f975eafd1fa5493
Author:     Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 7 20:13:24 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Wed Nov 7 20:13:24 2007 +0900

    rtc: rtc-sh: Zero out tm value for invalid rtc states.
    
    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 <[EMAIL PROTECTED]>
---
 drivers/rtc/rtc-sh.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index 61caed5..8e8c8b8 100644
--- 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;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to