Skip to contentSkip to conversation

RTC: RK808: remove tm_def structure

PATCH In review Chris Zhong 2 participants 2 messages Sep 11, 2014 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 RTC: RK808: remove tm_def structure

If the date/time is invalid at bootup, there's no reason to set it to a bogus value. We can just let the data and time be invalid until someone makes it valid.

---

Changes in v2:
Adviced by Doug Anderson
- add a description

 drivers/rtc/rtc-rk808.c |   17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)
drivers/rtc/rtc-rk808.c +2 -15
index 22c8514..df42257 100644
@@ -325,17 +325,6 @@ static int rk808_rtc_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(rk808_rtc_pm_ops,
 	rk808_rtc_suspend, rk808_rtc_resume);
 
-/* 2014.1.1 12:00:00 Saturday */
-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)
 {
 	struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent);
@@ -376,10 +365,8 @@ static int rk808_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 	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);
-	}
+	if (ret)
+		dev_warn(&pdev->dev, "invalid date/time\n");
 
 	device_init_wakeup(&pdev->dev, 1);
 
Signature · 1 line
1.7.9.5
#1 lore raw

Chris,

Quoted 8 lines · Chris Zhong

If the date/time is invalid at bootup, there's no reason to set it to a bogus value. We can just let the data and time be invalid until someone makes it valid.

No need to resend, but as Mark Brown has mentioned before please don't add spaces between tags. Just jam them together. Said another way:
no blank line between your Signed-off-by and my Reviewed-by.

-Doug