Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: s3c: stop setting bogus time

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

-15
-15
drivers/rtc/rtc-s3c.c
··· 382 382 static int s3c_rtc_probe(struct platform_device *pdev) 383 383 { 384 384 struct s3c_rtc *info = NULL; 385 - struct rtc_time rtc_tm; 386 385 int ret; 387 386 388 387 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); ··· 446 447 readw(info->base + S3C2410_RTCCON)); 447 448 448 449 device_init_wakeup(&pdev->dev, 1); 449 - 450 - /* Check RTC Time */ 451 - if (s3c_rtc_gettime(&pdev->dev, &rtc_tm)) { 452 - rtc_tm.tm_year = 100; 453 - rtc_tm.tm_mon = 0; 454 - rtc_tm.tm_mday = 1; 455 - rtc_tm.tm_hour = 0; 456 - rtc_tm.tm_min = 0; 457 - rtc_tm.tm_sec = 0; 458 - 459 - s3c_rtc_settime(&pdev->dev, &rtc_tm); 460 - 461 - dev_warn(&pdev->dev, "warning: invalid RTC value so initializing it\n"); 462 - } 463 450 464 451 /* register RTC and exit */ 465 452 info->rtc = devm_rtc_device_register(&pdev->dev, "s3c", &s3c_rtcops,