Skip to content

Commit 5c78cce

Browse files
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 22652ba ("rtc: stop validating rtc_time in .read_time") Signed-off-by: Alexandre Belloni <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 302757c commit 5c78cce

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

drivers/rtc/rtc-s3c.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ static int s3c_rtc_remove(struct platform_device *pdev)
382382
static int s3c_rtc_probe(struct platform_device *pdev)
383383
{
384384
struct s3c_rtc *info = NULL;
385-
struct rtc_time rtc_tm;
386385
int ret;
387386

388387
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
@@ -448,20 +447,6 @@ static int s3c_rtc_probe(struct platform_device *pdev)
448447

449448
device_init_wakeup(&pdev->dev, 1);
450449

451-
/* Check RTC Time */
452-
if (s3c_rtc_gettime(&pdev->dev, &rtc_tm)) {
453-
rtc_tm.tm_year = 100;
454-
rtc_tm.tm_mon = 0;
455-
rtc_tm.tm_mday = 1;
456-
rtc_tm.tm_hour = 0;
457-
rtc_tm.tm_min = 0;
458-
rtc_tm.tm_sec = 0;
459-
460-
s3c_rtc_settime(&pdev->dev, &rtc_tm);
461-
462-
dev_warn(&pdev->dev, "warning: invalid RTC value so initializing it\n");
463-
}
464-
465450
/* register RTC and exit */
466451
info->rtc = devm_rtc_device_register(&pdev->dev, "s3c", &s3c_rtcops,
467452
THIS_MODULE);

0 commit comments

Comments
 (0)