lkml.org 
[lkml]   [2014]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v10 1/3] RTC: RK808: add RTC driver for RK808
From
Andrew,

On Wed, Sep 10, 2014 at 1:44 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Wed, 10 Sep 2014 09:18:04 +0800 Chris Zhong <zyw@rock-chips.com> wrote:
>
>> Adding RTC driver for supporting RTC device present inside RK808 PMIC.
>>
>> ...
>>
>> + ret = rtc_valid_tm(&tm);
>> + if (ret) {
>> + dev_warn(&pdev->dev, "invalid date/time and init time\n");
>> + rk808_rtc_set_time(&pdev->dev, &tm_def);
>> + }
>
> This is somewhat unusual. Most drivers will emit a warning and give up
> when they find the time is wrong. Why is this driver different and is
> this desirable behaviour?

When you say "give up", what does that mean? I assume the driver
should keep initting, right? Then the user can go in and set a time
later...


I did test things with just removing this chunk of code. You get some
yells at bootup if you put a bogus time in there:

[ 2.987590] rk808-rtc rk808-rtc: invalid date/time and init time
[ 3.013148] rk808-rtc rk808-rtc: rtc core: registered rk808-rtc as rtc0
[ 4.586115] rk808-rtc rk808-rtc: hctosys: invalid date/time

...but if you later set a valid time then everything is fine. That
seems reasonable behavior to me, so I guess we could just remove this
whole chunk? It appears that after a normal bootup the date/time is
something valid.


-Doug


\
 
 \ /
  Last update: 2014-09-11 00:21    [W:0.517 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site