aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/time-ts.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/kernel/time-ts.c')
-rw-r--r--arch/blackfin/kernel/time-ts.c12
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
61static cycle_t read_cycles(void) 61static 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
66unsigned long long sched_clock(void)
67{
68 return cycles_2_ns(read_cycles());
69}
70
71static struct clocksource clocksource_bfin = { 66static 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
75unsigned long long sched_clock(void)
76{
77 return cycles_2_ns(read_cycles(&clocksource_bfin));
78}
79
80static int __init bfin_clocksource_init(void) 80static int __init bfin_clocksource_init(void)
81{ 81{
82 set_cyc2ns_scale(get_cclk() / 1000); 82 set_cyc2ns_scale(get_cclk() / 1000);