aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-08-14 08:15:23 -0400
committerArnd Bergmann <arnd@arndb.de>2018-12-18 10:13:05 -0500
commit926617889dc8383a120c66a2ecf7959a69f96950 (patch)
tree46426812a05100b6a0cd68b238d281dcf45d8b46
parent19f48591e67c83e74e1b612f180b96ce7f1eaf85 (diff)
timekeeping: remove unused {read,update}_persistent_clock
After arch/sh has removed the last reference to these functions, we can remove them completely and just rely on the 64-bit time_t based versions. This cleans up a rather ugly use of __weak functions. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--include/linux/timekeeping32.h6
-rw-r--r--kernel/time/ntp.c10
-rw-r--r--kernel/time/timekeeping.c12
3 files changed, 3 insertions, 25 deletions
diff --git a/include/linux/timekeeping32.h b/include/linux/timekeeping32.h
index a502616f7e1c..0036ff314ac5 100644
--- a/include/linux/timekeeping32.h
+++ b/include/linux/timekeeping32.h
@@ -52,10 +52,4 @@ static inline void getboottime(struct timespec *ts)
52 *ts = timespec64_to_timespec(ts64); 52 *ts = timespec64_to_timespec(ts64);
53} 53}
54 54
55/*
56 * Persistent clock related interfaces
57 */
58extern void read_persistent_clock(struct timespec *ts);
59extern int update_persistent_clock(struct timespec now);
60
61#endif 55#endif
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index c5e0cba3b39c..e23be418d015 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -555,17 +555,9 @@ static void sync_rtc_clock(void)
555} 555}
556 556
557#ifdef CONFIG_GENERIC_CMOS_UPDATE 557#ifdef CONFIG_GENERIC_CMOS_UPDATE
558int __weak update_persistent_clock(struct timespec now)
559{
560 return -ENODEV;
561}
562
563int __weak update_persistent_clock64(struct timespec64 now64) 558int __weak update_persistent_clock64(struct timespec64 now64)
564{ 559{
565 struct timespec now; 560 return -ENODEV;
566
567 now = timespec64_to_timespec(now64);
568 return update_persistent_clock(now);
569} 561}
570#endif 562#endif
571 563
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 2d110c948805..eb09be4871b3 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1467,7 +1467,7 @@ u64 timekeeping_max_deferment(void)
1467} 1467}
1468 1468
1469/** 1469/**
1470 * read_persistent_clock - Return time from the persistent clock. 1470 * read_persistent_clock64 - Return time from the persistent clock.
1471 * 1471 *
1472 * Weak dummy function for arches that do not yet support it. 1472 * Weak dummy function for arches that do not yet support it.
1473 * Reads the time from the battery backed persistent clock. 1473 * Reads the time from the battery backed persistent clock.
@@ -1475,20 +1475,12 @@ u64 timekeeping_max_deferment(void)
1475 * 1475 *
1476 * XXX - Do be sure to remove it once all arches implement it. 1476 * XXX - Do be sure to remove it once all arches implement it.
1477 */ 1477 */
1478void __weak read_persistent_clock(struct timespec *ts) 1478void __weak read_persistent_clock64(struct timespec64 *ts)
1479{ 1479{
1480 ts->tv_sec = 0; 1480 ts->tv_sec = 0;
1481 ts->tv_nsec = 0; 1481 ts->tv_nsec = 0;
1482} 1482}
1483 1483
1484void __weak read_persistent_clock64(struct timespec64 *ts64)
1485{
1486 struct timespec ts;
1487
1488 read_persistent_clock(&ts);
1489 *ts64 = timespec_to_timespec64(ts);
1490}
1491
1492/** 1484/**
1493 * read_persistent_wall_and_boot_offset - Read persistent clock, and also offset 1485 * read_persistent_wall_and_boot_offset - Read persistent clock, and also offset
1494 * from the boot. 1486 * from the boot.