diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2017-06-13 17:48:13 -0400 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2017-06-14 06:02:50 -0400 |
commit | c477990295a78f1248283322bd1ad964c22151bc (patch) | |
tree | a1439c22df958cc7e842bab7107aa05519335299 /drivers/clocksource/timer-fttmr010.c | |
parent | 385c98fcc1fb58c3e10157be2203eb37595dac7b (diff) |
clocksource/drivers/fttmr010: Factor out clock read code
The sched_clock() and delay timer callbacks can just call
each other and we can save an #ifdef.
Suggested-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Andrew Jeffery <andrew@aj.id.au>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Jonas Jensen <jonas.jensen@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/clocksource/timer-fttmr010.c')
-rw-r--r-- | drivers/clocksource/timer-fttmr010.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index 009370460f23..66dd909960c6 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c | |||
@@ -98,30 +98,26 @@ static inline struct fttmr010 *to_fttmr010(struct clock_event_device *evt) | |||
98 | return container_of(evt, struct fttmr010, clkevt); | 98 | return container_of(evt, struct fttmr010, clkevt); |
99 | } | 99 | } |
100 | 100 | ||
101 | static u64 notrace fttmr010_read_sched_clock_up(void) | 101 | static unsigned long fttmr010_read_current_timer_up(void) |
102 | { | 102 | { |
103 | return readl(local_fttmr->base + TIMER2_COUNT); | 103 | return readl(local_fttmr->base + TIMER2_COUNT); |
104 | } | 104 | } |
105 | 105 | ||
106 | static u64 notrace fttmr010_read_sched_clock_down(void) | 106 | static unsigned long fttmr010_read_current_timer_down(void) |
107 | { | 107 | { |
108 | return ~readl(local_fttmr->base + TIMER2_COUNT); | 108 | return ~readl(local_fttmr->base + TIMER2_COUNT); |
109 | } | 109 | } |
110 | 110 | ||
111 | #ifdef CONFIG_ARM | 111 | static u64 notrace fttmr010_read_sched_clock_up(void) |
112 | |||
113 | static unsigned long fttmr010_read_current_timer_up(void) | ||
114 | { | 112 | { |
115 | return readl(local_fttmr->base + TIMER2_COUNT); | 113 | return fttmr010_read_current_timer_up(); |
116 | } | 114 | } |
117 | 115 | ||
118 | static unsigned long fttmr010_read_current_timer_down(void) | 116 | static u64 notrace fttmr010_read_sched_clock_down(void) |
119 | { | 117 | { |
120 | return ~readl(local_fttmr->base + TIMER2_COUNT); | 118 | return fttmr010_read_current_timer_down(); |
121 | } | 119 | } |
122 | 120 | ||
123 | #endif | ||
124 | |||
125 | static int fttmr010_timer_set_next_event(unsigned long cycles, | 121 | static int fttmr010_timer_set_next_event(unsigned long cycles, |
126 | struct clock_event_device *evt) | 122 | struct clock_event_device *evt) |
127 | { | 123 | { |