]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
clocksource/drivers/fttmr010: Factor out clock read code
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 13 Jun 2017 21:48:13 +0000 (23:48 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 14 Jun 2017 10:02:50 +0000 (12:02 +0200)
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>
drivers/clocksource/timer-fttmr010.c

index 009370460f234c3507952cee19ccc4499366cfc1..66dd909960c69fd63c9ef465a9ddfb735d12ae4b 100644 (file)
@@ -98,30 +98,26 @@ static inline struct fttmr010 *to_fttmr010(struct clock_event_device *evt)
        return container_of(evt, struct fttmr010, clkevt);
 }
 
-static u64 notrace fttmr010_read_sched_clock_up(void)
+static unsigned long fttmr010_read_current_timer_up(void)
 {
        return readl(local_fttmr->base + TIMER2_COUNT);
 }
 
-static u64 notrace fttmr010_read_sched_clock_down(void)
+static unsigned long fttmr010_read_current_timer_down(void)
 {
        return ~readl(local_fttmr->base + TIMER2_COUNT);
 }
 
-#ifdef CONFIG_ARM
-
-static unsigned long fttmr010_read_current_timer_up(void)
+static u64 notrace fttmr010_read_sched_clock_up(void)
 {
-       return readl(local_fttmr->base + TIMER2_COUNT);
+       return fttmr010_read_current_timer_up();
 }
 
-static unsigned long fttmr010_read_current_timer_down(void)
+static u64 notrace fttmr010_read_sched_clock_down(void)
 {
-       return ~readl(local_fttmr->base + TIMER2_COUNT);
+       return fttmr010_read_current_timer_down();
 }
 
-#endif
-
 static int fttmr010_timer_set_next_event(unsigned long cycles,
                                       struct clock_event_device *evt)
 {