Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp220920pxb; Tue, 2 Feb 2021 03:35:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJz05S1hXDrd1LTHiq8Yg1eLBuc8OXWKjahWNcOU4WMwiba3IUPPFsbUzRMhdXTzpbMQVEX4 X-Received: by 2002:aa7:cdcd:: with SMTP id h13mr5646765edw.11.1612265721009; Tue, 02 Feb 2021 03:35:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612265721; cv=none; d=google.com; s=arc-20160816; b=j9TWknzLzEygNaR1BsI7JeWAOkVnn79QD6i1WpaiylrU3FVXPN/RxqTGthhMUZqVLd RrRYMkq3DTkNHEN8Q/PnT+eR6acQ8lUMji1zi2YG9o57VIaPiE/JoG8wLe6a3f7/RGik ho/OswsqQqdMXfAI4AT1NzctO2sUC7rdCsSZdCWaFbCMOzFL/QJ53DsGc4Zdt2PUuHH2 N6dJ7we2Ur5vICJbpQ427auiiEkiSrMDxEqTgqz/aSn5EQr2yauV7PyIi1E3e5e4v2WF FMdIe7mgHLI3KOqnESnLuI/A5FEg1o6th2nQBHmu+sY+pJ4Fax1eep8a2hMZXa5MNYR8 oKtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Udn90us0/Tvc8AhwQDvm6wHLYWLQ4GGFp4CuF0I7E8o=; b=uzb/tPlGpAdaMPLIO0pAVgz8eMxmpl1NyC6BTGSncdmlBb8FyINsRkEXCcYGHZLpPB BO/c96Kc7mGJwOEvFBtaq461xvV7PgTnZaKQ9PljH1vEnrTYTgKeElSyQyrzSHxXS0dY hJ+31iCJkWNqAeCp95os7zFWxHq3LFXqjcbqIY57p5i/wq4j9xnIpXt1GN8dry25jVgu naFkm74qSkugDNluo02LcDDTpZ2kNZ2/vH4BSlC3psODqtn8rRqZja6cbpJ/aXB2xNZK dXWw9Gv2K+7TDaJbx8/1Z0QwiQBXIRca8gMgZ6PAHprHcA8Y8qdIPx7OTM1rB+0IgiEA DNzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o19si13391704edz.565.2021.02.02.03.34.55; Tue, 02 Feb 2021 03:35:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229606AbhBBLeC (ORCPT + 99 others); Tue, 2 Feb 2021 06:34:02 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:60985 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbhBBLad (ORCPT ); Tue, 2 Feb 2021 06:30:33 -0500 X-Originating-IP: 86.202.109.140 Received: from localhost (lfbn-lyo-1-13-140.w86-202.abo.wanadoo.fr [86.202.109.140]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 4857A60008; Tue, 2 Feb 2021 11:29:46 +0000 (UTC) From: Alexandre Belloni To: linux-rtc@vger.kernel.org, Marek Szyprowski , Alessandro Zummo , Alexandre Belloni Cc: linux-kernel@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH 1/2] rtc: s3c: stop setting bogus time Date: Tue, 2 Feb 2021 12:29:33 +0100 Message-Id: <20210202112934.3612726-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It doesn't make sense to set the RTC to a default value at probe time. Let the core handle invalid date and time. Also, this is basically dead code since commit 22652ba72453 ("rtc: stop validating rtc_time in .read_time") Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-s3c.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index fab326ba9cec..f07b0c43aafe 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -382,7 +382,6 @@ static int s3c_rtc_remove(struct platform_device *pdev) static int s3c_rtc_probe(struct platform_device *pdev) { struct s3c_rtc *info = NULL; - struct rtc_time rtc_tm; int ret; info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); @@ -448,20 +447,6 @@ static int s3c_rtc_probe(struct platform_device *pdev) device_init_wakeup(&pdev->dev, 1); - /* Check RTC Time */ - if (s3c_rtc_gettime(&pdev->dev, &rtc_tm)) { - rtc_tm.tm_year = 100; - rtc_tm.tm_mon = 0; - rtc_tm.tm_mday = 1; - rtc_tm.tm_hour = 0; - rtc_tm.tm_min = 0; - rtc_tm.tm_sec = 0; - - s3c_rtc_settime(&pdev->dev, &rtc_tm); - - dev_warn(&pdev->dev, "warning: invalid RTC value so initializing it\n"); - } - /* register RTC and exit */ info->rtc = devm_rtc_device_register(&pdev->dev, "s3c", &s3c_rtcops, THIS_MODULE); -- 2.29.2