mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Cc: Andrew Jeffery <[email protected]> Cc: Joel Stanley <[email protected]> Cc: Jonas Jensen <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
This commit is contained in:
parent
385c98fcc1
commit
c477990295
1 changed files with 6 additions and 10 deletions
|
|
@ -98,18 +98,6 @@ 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)
|
||||
{
|
||||
return readl(local_fttmr->base + TIMER2_COUNT);
|
||||
}
|
||||
|
||||
static u64 notrace fttmr010_read_sched_clock_down(void)
|
||||
{
|
||||
return ~readl(local_fttmr->base + TIMER2_COUNT);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ARM
|
||||
|
||||
static unsigned long fttmr010_read_current_timer_up(void)
|
||||
{
|
||||
return readl(local_fttmr->base + TIMER2_COUNT);
|
||||
|
|
@ -120,7 +108,15 @@ static unsigned long fttmr010_read_current_timer_down(void)
|
|||
return ~readl(local_fttmr->base + TIMER2_COUNT);
|
||||
}
|
||||
|
||||
#endif
|
||||
static u64 notrace fttmr010_read_sched_clock_up(void)
|
||||
{
|
||||
return fttmr010_read_current_timer_up();
|
||||
}
|
||||
|
||||
static u64 notrace fttmr010_read_sched_clock_down(void)
|
||||
{
|
||||
return fttmr010_read_current_timer_down();
|
||||
}
|
||||
|
||||
static int fttmr010_timer_set_next_event(unsigned long cycles,
|
||||
struct clock_event_device *evt)
|
||||
|
|
|
|||
Loading…
Reference in a new issue