[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140910134411.8128acce79f2423d4448e8f4@linux-foundation.org>
Date: Wed, 10 Sep 2014 13:44:11 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Chris Zhong <zyw@...k-chips.com>
Cc: dianders@...omium.org, heiko@...ech.de, robh+dt@...nel.org,
pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
sameo@...ux.intel.com, lee.jones@...aro.org, lgirdwood@...il.com,
a.zummo@...ertech.it, mturquette@...aro.org, broonie@...nel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
rtc-linux@...glegroups.com, grant.likely@...aro.org,
hl@...k-chips.com, huangtao@...k-chips.com, cf@...k-chips.com,
zhangqing@...k-chips.com, xxx@...k-chips.com, olof@...om.net,
sonnyrao@...omium.org, dtor@...omium.org,
javier.martinez@...labora.co.uk, kever.yang@...k-chips.com
Subject: Re: [PATCH v10 1/3] RTC: RK808: add RTC driver for RK808
On Wed, 10 Sep 2014 09:18:04 +0800 Chris Zhong <zyw@...k-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?
Also, I did this:
From: Andrew Morton <akpm@...ux-foundation.org>
Subject: rtc-rk808-add-rtc-driver-for-rk808-fix
make tm_def static
Cc: Chris Zhong <zyw@...k-chips.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
drivers/rtc/rtc-rk808.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff -puN drivers/rtc/Kconfig~rtc-rk808-add-rtc-driver-for-rk808-fix drivers/rtc/Kconfig
diff -puN drivers/rtc/Makefile~rtc-rk808-add-rtc-driver-for-rk808-fix drivers/rtc/Makefile
diff -puN drivers/rtc/rtc-rk808.c~rtc-rk808-add-rtc-driver-for-rk808-fix drivers/rtc/rtc-rk808.c
--- a/drivers/rtc/rtc-rk808.c~rtc-rk808-add-rtc-driver-for-rk808-fix
+++ a/drivers/rtc/rtc-rk808.c
@@ -326,14 +326,14 @@ static SIMPLE_DEV_PM_OPS(rk808_rtc_pm_op
rk808_rtc_suspend, rk808_rtc_resume);
/* 2014.1.1 12:00:00 Saturday */
-struct rtc_time tm_def = {
- .tm_wday = 6,
- .tm_year = 114,
- .tm_mon = 0,
- .tm_mday = 1,
- .tm_hour = 12,
- .tm_min = 0,
- .tm_sec = 0,
+static struct rtc_time tm_def = {
+ .tm_wday = 6,
+ .tm_year = 114,
+ .tm_mon = 0,
+ .tm_mday = 1,
+ .tm_hour = 12,
+ .tm_min = 0,
+ .tm_sec = 0,
};
static int rk808_rtc_probe(struct platform_device *pdev)
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists