From patchwork Thu Sep 11 07:37:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 388090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-qc0-x23c.google.com (mail-qc0-x23c.google.com [IPv6:2607:f8b0:400d:c01::23c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 59DF0140120 for ; Thu, 11 Sep 2014 17:38:23 +1000 (EST) Received: by mail-qc0-f188.google.com with SMTP id i8sf3844554qcq.25 for ; Thu, 11 Sep 2014 00:38:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:from:to:cc:subject:date:message-id:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=yApZ47rb9ffczoZvQeSWUIQTWSVLwTrxIiyioLpkAxw=; b=ukA6aqw2Gk0QEMMxU8mujPv8mnPQ/Vz4XgQVg44p4JNgDSohTuJZgyGOpWjEoF2Ygh 4IygqsnBjbT+imSNZq7n3USHoQuA33UqbjqiiFA6+Be5RmjwMsc9uKsFYnUOGumMDlvv KPEPwvEQWrWOxAYx3iE88nchFn49RsncYl26VdWix5Y9IklJu9wZvEDcDFcYcRNtetsv 2rstdEkrcHLQXMWwgStJLZPoImqlbAbdKWfIxD/ga+gh01RmsmjLjuFgLr2UyJdKkxIe D/Mtj5C3fDrshJQztGukd3vCsqzYEvWuW55D6fQ7HEdD5kUM6mhE17ZXZLuC6mcVKuWP zDyg== X-Received: by 10.140.20.83 with SMTP id 77mr681355qgi.0.1410421099271; Thu, 11 Sep 2014 00:38:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.140.16.99 with SMTP id 90ls57946qga.62.gmail; Thu, 11 Sep 2014 00:38:18 -0700 (PDT) X-Received: by 10.236.31.68 with SMTP id l44mr28384130yha.29.1410421098873; Thu, 11 Sep 2014 00:38:18 -0700 (PDT) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by gmr-mx.google.com with ESMTPS id ss9si26230pab.1.2014.09.11.00.38.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Sep 2014 00:38:18 -0700 (PDT) Received-SPF: pass (google.com: domain of zywang33@gmail.com designates 209.85.220.50 as permitted sender) client-ip=209.85.220.50; Received: by mail-pa0-f50.google.com with SMTP id bj1so7434811pad.9 for ; Thu, 11 Sep 2014 00:38:18 -0700 (PDT) X-Received: by 10.66.155.2 with SMTP id vs2mr71227067pab.60.1410421098173; Thu, 11 Sep 2014 00:38:18 -0700 (PDT) Received: from localhost.localdomain ([69.176.84.147]) by mx.google.com with ESMTPSA id tx8sm201224pac.42.2014.09.11.00.38.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Sep 2014 00:38:17 -0700 (PDT) From: Chris Zhong To: akpm@linux-foundation.org Cc: zhangqing@rock-chips.com, xxx@rock-chips.com, dianders@chromium.org, heiko@sntech.de, Chris Zhong , Alessandro Zummo , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [rtc-linux] [PATCH v2] RTC: RK808: remove tm_def structure Date: Thu, 11 Sep 2014 15:37:43 +0800 Message-Id: <1410421063-3028-1-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 1.7.9.5 X-Original-Sender: zyw@rock-chips.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of zywang33@gmail.com designates 209.85.220.50 as permitted sender) smtp.mail=zywang33@gmail.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , 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. Signed-off-by: Chris Zhong Reviewed-by: Doug Anderson Tested-by: Doug Anderson --- Changes in v2: Adviced by Doug Anderson - add a description drivers/rtc/rtc-rk808.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/rtc/rtc-rk808.c b/drivers/rtc/rtc-rk808.c index 22c8514..df42257 100644 --- a/drivers/rtc/rtc-rk808.c +++ b/drivers/rtc/rtc-rk808.c @@ -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);