diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-04-21 15:24:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-21 16:41:47 -0400 |
commit | 8e19608e8b5c001e4a66ce482edc474f05fb7355 (patch) | |
tree | 06af4be339136da7476396604c30112238d84339 /arch/blackfin/kernel/time-ts.c | |
parent | ff14ed5db6e7e5e5dc23712d3c877891d4d9a1a8 (diff) |
clocksource: pass clocksource to read() callback
Pass clocksource pointer to the read() callback for clocksources. This
allows us to share the callback between multiple instances.
[hugh@veritas.com: fix powerpc build of clocksource pass clocksource mods]
[akpm@linux-foundation.org: cleanup]
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/blackfin/kernel/time-ts.c')
-rw-r--r-- | arch/blackfin/kernel/time-ts.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c index 0ed2badfd746..27646121280a 100644 --- a/arch/blackfin/kernel/time-ts.c +++ b/arch/blackfin/kernel/time-ts.c | |||
@@ -58,16 +58,11 @@ static inline unsigned long long cycles_2_ns(cycle_t cyc) | |||
58 | return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; | 58 | return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; |
59 | } | 59 | } |
60 | 60 | ||
61 | static cycle_t read_cycles(void) | 61 | static cycle_t read_cycles(struct clocksource *cs) |
62 | { | 62 | { |
63 | return __bfin_cycles_off + (get_cycles() << __bfin_cycles_mod); | 63 | return __bfin_cycles_off + (get_cycles() << __bfin_cycles_mod); |
64 | } | 64 | } |
65 | 65 | ||
66 | unsigned long long sched_clock(void) | ||
67 | { | ||
68 | return cycles_2_ns(read_cycles()); | ||
69 | } | ||
70 | |||
71 | static struct clocksource clocksource_bfin = { | 66 | static struct clocksource clocksource_bfin = { |
72 | .name = "bfin_cycles", | 67 | .name = "bfin_cycles", |
73 | .rating = 350, | 68 | .rating = 350, |
@@ -77,6 +72,11 @@ static struct clocksource clocksource_bfin = { | |||
77 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 72 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
78 | }; | 73 | }; |
79 | 74 | ||
75 | unsigned long long sched_clock(void) | ||
76 | { | ||
77 | return cycles_2_ns(read_cycles(&clocksource_bfin)); | ||
78 | } | ||
79 | |||
80 | static int __init bfin_clocksource_init(void) | 80 | static int __init bfin_clocksource_init(void) |
81 | { | 81 | { |
82 | set_cyc2ns_scale(get_cclk() / 1000); | 82 | set_cyc2ns_scale(get_cclk() / 1000); |