aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/clocksource.h
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2015-03-11 21:16:37 -0700
committerIngo Molnar <mingo@kernel.org>2015-03-13 08:07:06 +0100
commitf8935983f110505daa38e8d36ee406807f83a069 (patch)
tree223f168e944f3d114c6f6c1ec30dcf2398a154a3 /include/linux/clocksource.h
parentclocksource: Improve clocksource watchdog reporting (diff)
downloadwireguard-linux-f8935983f110505daa38e8d36ee406807f83a069.tar.xz
wireguard-linux-f8935983f110505daa38e8d36ee406807f83a069.zip
clocksource: Mostly kill clocksource_register()
A long running project has been to clean up remaining uses of clocksource_register(), replacing it with the simpler clocksource_register_khz/hz() functions. However, there are a few cases where we need to self-define our mult/shift values, so switch the function to a more obviously internal __clocksource_register() name, and consolidate much of the internal logic so we don't have duplication. Signed-off-by: John Stultz <john.stultz@linaro.org> Cc: Dave Jones <davej@codemonkey.org.uk> Cc: David S. Miller <davem@davemloft.net> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Stephen Boyd <sboyd@codeaurora.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1426133800-29329-10-git-send-email-john.stultz@linaro.org [ Minor cleanups. ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/clocksource.h')
-rw-r--r--include/linux/clocksource.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 16d048cadebb..bd98eaa4d005 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -179,7 +179,6 @@ static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift)
}
-extern int clocksource_register(struct clocksource*);
extern int clocksource_unregister(struct clocksource*);
extern void clocksource_touch_watchdog(void);
extern struct clocksource* clocksource_get_next(void);
@@ -203,6 +202,15 @@ __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
extern void
__clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq);
+/*
+ * Don't call this unless you are a default clocksource
+ * (AKA: jiffies) and absolutely have to.
+ */
+static inline int __clocksource_register(struct clocksource *cs)
+{
+ return __clocksource_register_scale(cs, 1, 0);
+}
+
static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
{
return __clocksource_register_scale(cs, 1, hz);