linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/6] rtc: 88pm860x: stop setting a default time
Date: Wed, 11 Mar 2020 23:39:52 +0100	[thread overview]
Message-ID: <20200311223956.51352-2-alexandre.belloni@bootlin.com> (raw)
In-Reply-To: <20200311223956.51352-1-alexandre.belloni@bootlin.com>

It doesn't make sense to set the RTC to a default value at probe time. Let
the core handle invalid date and time.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-88pm860x.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/rtc/rtc-88pm860x.c b/drivers/rtc/rtc-88pm860x.c
index 1526402e126b..d6aca28905e3 100644
--- a/drivers/rtc/rtc-88pm860x.c
+++ b/drivers/rtc/rtc-88pm860x.c
@@ -360,19 +360,6 @@ static int pm860x_rtc_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "Failed to read initial time.\n");
 		return ret;
 	}
-	if ((tm.tm_year < 70) || (tm.tm_year > 138)) {
-		tm.tm_year = 70;
-		tm.tm_mon = 0;
-		tm.tm_mday = 1;
-		tm.tm_hour = 0;
-		tm.tm_min = 0;
-		tm.tm_sec = 0;
-		ret = pm860x_rtc_set_time(&pdev->dev, &tm);
-		if (ret < 0) {
-			dev_err(&pdev->dev, "Failed to set initial time.\n");
-			return ret;
-		}
-	}
 	rtc_tm_to_time(&tm, &ticks);
 	if (pm860x_rtc_dt_init(pdev, info)) {
 		if (pdata && pdata->sync) {
-- 
2.24.1


  reply	other threads:[~2020-03-11 22:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 22:39 [PATCH 1/6] rtc: 88pm860x: fix possible race condition Alexandre Belloni
2020-03-11 22:39 ` Alexandre Belloni [this message]
2020-03-11 22:39 ` [PATCH 3/6] rtc: 88pm860x: stop calling unused callback Alexandre Belloni
2020-03-11 22:39 ` [PATCH 4/6] rtc: 88pm860x: set range Alexandre Belloni
2020-03-11 22:39 ` [PATCH 5/6] rtc: 88pm860x: stop mangling alarm time Alexandre Belloni
2020-03-11 22:39 ` [PATCH 6/6] rtc: 88pm860x: switch to rtc_time64_to_tm/rtc_tm_to_time64 Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200311223956.51352-2-alexandre.belloni@bootlin.com \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).