Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218500
b: refs/heads/master
c: e1df962
h: refs/heads/master
v: v3
  • Loading branch information
Changhwan Youn authored and Linus Torvalds committed Oct 28, 2010
1 parent 79e94f2 commit c2ba3f1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 30ffc40cf52cd68782b50cb699b5eca076ca23ab
refs/heads/master: e1df962e6cdc431acb6a8da409b6a7d89c4f782e
18 changes: 13 additions & 5 deletions trunk/drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev)
static int __devinit s3c_rtc_probe(struct platform_device *pdev)
{
struct rtc_device *rtc;
struct rtc_time rtc_tm;
struct resource *res;
unsigned int tmp, i;
int ret;

pr_debug("%s: probe=%p\n", __func__, pdev);
Expand Down Expand Up @@ -538,11 +538,19 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)

/* Check RTC Time */

for (i = S3C2410_RTCSEC; i <= S3C2410_RTCYEAR; i += 0x4) {
tmp = readb(s3c_rtc_base + i);
s3c_rtc_gettime(NULL, &rtc_tm);

if ((tmp & 0xf) > 0x9 || ((tmp >> 4) & 0xf) > 0x9)
writeb(0, s3c_rtc_base + i);
if (rtc_valid_tm(&rtc_tm)) {
rtc_tm.tm_year = 100;
rtc_tm.tm_mon = 0;
rtc_tm.tm_mday = 1;
rtc_tm.tm_hour = 0;
rtc_tm.tm_min = 0;
rtc_tm.tm_sec = 0;

s3c_rtc_settime(NULL, &rtc_tm);

dev_warn(&pdev->dev, "warning: invalid RTC value so initializing it\n");
}

if (s3c_rtc_cpu_type == TYPE_S3C64XX)
Expand Down

0 comments on commit c2ba3f1

Please sign in to comment.