summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-88pm80x.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-05-17 22:18:56 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-05-17 22:23:15 +0200
commit48b29c7fc2491edabd3d0f1e68f721043e4a079f (patch)
treecde463008466ef059ac5f870e56cf2146ea539ff /drivers/rtc/rtc-88pm80x.c
parentrtc: at91rm9200: add range (diff)
downloadlinux-48b29c7fc2491edabd3d0f1e68f721043e4a079f.tar.xz
linux-48b29c7fc2491edabd3d0f1e68f721043e4a079f.zip
rtc: 88pm80x: stop setting a default 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. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-88pm80x.c')
-rw-r--r--drivers/rtc/rtc-88pm80x.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/drivers/rtc/rtc-88pm80x.c b/drivers/rtc/rtc-88pm80x.c
index 6cbafefa80a2..76df274f3e1a 100644
--- a/drivers/rtc/rtc-88pm80x.c
+++ b/drivers/rtc/rtc-88pm80x.c
@@ -254,8 +254,6 @@ static int pm80x_rtc_probe(struct platform_device *pdev)
struct pm80x_rtc_pdata *pdata = dev_get_platdata(&pdev->dev);
struct pm80x_rtc_info *info;
struct device_node *node = pdev->dev.of_node;
- struct rtc_time tm;
- unsigned long ticks = 0;
int ret;
if (!pdata && !node) {
@@ -302,26 +300,6 @@ static int pm80x_rtc_probe(struct platform_device *pdev)
goto out;
}
- ret = pm80x_rtc_read_time(&pdev->dev, &tm);
- if (ret < 0) {
- dev_err(&pdev->dev, "Failed to read initial time.\n");
- goto out_rtc;
- }
- 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 = pm80x_rtc_set_time(&pdev->dev, &tm);
- if (ret < 0) {
- dev_err(&pdev->dev, "Failed to set initial time.\n");
- goto out_rtc;
- }
- }
- rtc_tm_to_time(&tm, &ticks);
-
info->rtc_dev = devm_rtc_device_register(&pdev->dev, "88pm80x-rtc",
&pm80x_rtc_ops, THIS_MODULE);
if (IS_ERR(info->rtc_dev)) {