aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-sh.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-sh.c')
-rw-r--r--drivers/rtc/rtc-sh.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index d417b203cbc5..7fffe6da9478 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -276,6 +276,9 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm)
276 struct sh_rtc *rtc = dev_get_drvdata(dev); 276 struct sh_rtc *rtc = dev_get_drvdata(dev);
277 unsigned int sec128, sec2, yr, yr100, cf_bit; 277 unsigned int sec128, sec2, yr, yr100, cf_bit;
278 278
279 if (!(readb(rtc->regbase + RCR2) & RCR2_RTCEN))
280 return -EINVAL;
281
279 do { 282 do {
280 unsigned int tmp; 283 unsigned int tmp;
281 284
@@ -466,7 +469,6 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
466{ 469{
467 struct sh_rtc *rtc; 470 struct sh_rtc *rtc;
468 struct resource *res; 471 struct resource *res;
469 struct rtc_time r;
470 char clk_name[6]; 472 char clk_name[6];
471 int clk_id, ret; 473 int clk_id, ret;
472 474
@@ -600,12 +602,6 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
600 602
601 rtc->rtc_dev->max_user_freq = 256; 603 rtc->rtc_dev->max_user_freq = 256;
602 604
603 /* reset rtc to epoch 0 if time is invalid */
604 if (rtc_read_time(rtc->rtc_dev, &r) < 0) {
605 rtc_time_to_tm(0, &r);
606 rtc_set_time(rtc->rtc_dev, &r);
607 }
608
609 device_init_wakeup(&pdev->dev, 1); 605 device_init_wakeup(&pdev->dev, 1);
610 return 0; 606 return 0;
611 607