time: Add the common weak version of update_persistent_clock()
authorXunlei Pang <pang.xunlei@linaro.org>
Sun, 26 Jul 2015 10:45:39 +0000 (18:45 +0800)
committerJohn Stultz <john.stultz@linaro.org>
Mon, 17 Aug 2015 18:25:16 +0000 (11:25 -0700)
The weak update_persistent_clock64() calls update_persistent_clock(),
if the architecture defines an update_persistent_clock64() to replace
and remove its update_persistent_clock() version, when building the
kernel the linker will throw an undefined symbol error, that is, any
arch that switches to update_persistent_clock64() will have this issue.

To solve the issue, we add the common weak update_persistent_clock().

Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
kernel/time/ntp.c

index fb4d98c7fd43e715d795d8df2c522c80b2204361..df68cb87524885dd561b615300137a68d7ecfbdb 100644 (file)
@@ -487,6 +487,11 @@ out:
 }
 
 #ifdef CONFIG_GENERIC_CMOS_UPDATE
+int __weak update_persistent_clock(struct timespec now)
+{
+       return -ENODEV;
+}
+
 int __weak update_persistent_clock64(struct timespec64 now64)
 {
        struct timespec now;