aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2013-04-25 16:31:44 -0400
committerThomas Gleixner <tglx@linutronix.de>2013-05-16 05:09:14 -0400
commit09ac369c825d9d593404306d59062d854b321e9b (patch)
tree0d07679956f56d3203aff526412ec82862083b9a /include
parentba919d1caa2e624eb8c6cae1f2ce0a253e697d45 (diff)
clocksource: Add module refcount
Add a module refcount, so the current clocksource cannot be removed unconditionally. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: John Stultz <john.stultz@linaro.org> Cc: Magnus Damm <magnus.damm@gmail.com> Link: http://lkml.kernel.org/r/20130425143435.762417789@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/clocksource.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index aa6ba44e75d5..32a895b114d8 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -21,6 +21,7 @@
21/* clocksource cycle base type */ 21/* clocksource cycle base type */
22typedef u64 cycle_t; 22typedef u64 cycle_t;
23struct clocksource; 23struct clocksource;
24struct module;
24 25
25#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA 26#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
26#include <asm/clocksource.h> 27#include <asm/clocksource.h>
@@ -162,6 +163,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
162 * @suspend: suspend function for the clocksource, if necessary 163 * @suspend: suspend function for the clocksource, if necessary
163 * @resume: resume function for the clocksource, if necessary 164 * @resume: resume function for the clocksource, if necessary
164 * @cycle_last: most recent cycle counter value seen by ::read() 165 * @cycle_last: most recent cycle counter value seen by ::read()
166 * @owner: module reference, must be set by clocksource in modules
165 */ 167 */
166struct clocksource { 168struct clocksource {
167 /* 169 /*
@@ -195,6 +197,7 @@ struct clocksource {
195 cycle_t cs_last; 197 cycle_t cs_last;
196 cycle_t wd_last; 198 cycle_t wd_last;
197#endif 199#endif
200 struct module *owner;
198} ____cacheline_aligned; 201} ____cacheline_aligned;
199 202
200/* 203/*