]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rtc: s3c: stop setting bogus time
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 2 Feb 2021 11:29:33 +0000 (12:29 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 5 Feb 2021 23:59:16 +0000 (00:59 +0100)
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 <alexandre.belloni@bootlin.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20210202112934.3612726-1-alexandre.belloni@bootlin.com
drivers/rtc/rtc-s3c.c

index fab326ba9ceced1c9b7eea1f594773a02e5f0b0c..f07b0c43aafe017b7f1afb64e69f3f4d7b749680 100644 (file)
@@ -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);