The patch titled Subject: drivers/rtc/rtc-s3c.c: fix failed first read of RTC time has been added to the -mm tree. Its filename is rtc-rtc-s3c-fix-failed-first-read-of-rtc-time.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/rtc-rtc-s3c-fix-failed-first-read-of-rtc-time.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/rtc-rtc-s3c-fix-failed-first-read-of-rtc-time.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Krzysztof Kozlowski <k.kozlowski@xxxxxxxxxxx> Subject: drivers/rtc/rtc-s3c.c: fix failed first read of RTC time Initialize the device time (if it is wrong) before registering RTC device to fix following error message during rtc-s3c probe: [ 2.215414] rtc (null): read_time: fail to read [ 2.216322] s3c-rtc 10070000.rtc: rtc core: registered s3c as rtc1 Signed-off-by: Krzysztof Kozlowski <k.kozlowski@xxxxxxxxxxx> Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx> Cc: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxxxxxxxxx> Cc: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/rtc/rtc-s3c.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff -puN drivers/rtc/rtc-s3c.c~rtc-rtc-s3c-fix-failed-first-read-of-rtc-time drivers/rtc/rtc-s3c.c --- a/drivers/rtc/rtc-s3c.c~rtc-rtc-s3c-fix-failed-first-read-of-rtc-time +++ a/drivers/rtc/rtc-s3c.c @@ -496,6 +496,22 @@ static int s3c_rtc_probe(struct platform device_init_wakeup(&pdev->dev, 1); + /* Check RTC Time */ + s3c_rtc_gettime(&pdev->dev, &rtc_tm); + + 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(&pdev->dev, &rtc_tm); + + dev_warn(&pdev->dev, "warning: invalid RTC value so initializing it\n"); + } + /* register RTC and exit */ info->rtc = devm_rtc_device_register(&pdev->dev, "s3c", &s3c_rtcops, THIS_MODULE); @@ -519,22 +535,6 @@ static int s3c_rtc_probe(struct platform goto err_nortc; } - /* Check RTC Time */ - s3c_rtc_gettime(&pdev->dev, &rtc_tm); - - 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(&pdev->dev, &rtc_tm); - - dev_warn(&pdev->dev, "warning: invalid RTC value so initializing it\n"); - } - if (info->data->select_tick_clk) info->data->select_tick_clk(info); _ Patches currently in -mm which might be from k.kozlowski@xxxxxxxxxxx are rtc-rtc-ab-b5ze-s3-constify-struct-regmap_config.patch rtc-s5m-add-support-for-s2mps13-rtc.patch rtc-rtc-s3c-fix-failed-first-read-of-rtc-time.patch linux-next.patch rtc-s5m-allow-usage-on-device-type-different-than-main-mfd-type.patch rtc-s5m-allow-usage-on-device-type-different-than-main-mfd-type-v2.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html