[PATCH 3/3] rtc: Skip setting xtime if persisent clock exist

From: Feng Tang
Date: Wed Dec 12 2012 - 21:05:28 EST


As the timekeeping_init() already initialize the xtime with
read_persistent_clock().

Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: John Stultz <john.stultz@xxxxxxxxxx>
Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
Cc: Arve HjÃnnevÃg <arve@xxxxxxxxxxx>
Signed-off-by: Feng Tang <feng.tang@xxxxxxxxx>
---
drivers/rtc/hctosys.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/rtc/hctosys.c b/drivers/rtc/hctosys.c
index 4aa60d7..2b539cd 100644
--- a/drivers/rtc/hctosys.c
+++ b/drivers/rtc/hctosys.c
@@ -52,6 +52,10 @@ static int __init rtc_hctosys(void)
goto err_invalid;
}

+ /* Skip setting xtime again if persistent clock exist */
+ if (persistent_clock_exist)
+ goto skip_timeset;
+
rtc_tm_to_time(&tm, &tv.tv_sec);

err = do_settimeofday(&tv);
@@ -65,6 +69,7 @@ static int __init rtc_hctosys(void)

err_invalid:
err_read:
+skip_timeset:
rtc_class_close(rtc);

err_open:
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/