Skip to content

Commit f48729a

Browse files
Benjamin-GaignardDaniel Lezcano
authored andcommitted
clocksource/drivers/timer-of: Add timer_of_exit function
The timer-of API does not provide a function to undo what has been done by the timer_of_init() function. Add a timer_of_exit() function. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent f16ff2b commit f48729a

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎drivers/clocksource/timer-of.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,15 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to)
176176
timer_base_exit(&to->of_base);
177177
return ret;
178178
}
179+
180+
void timer_of_exit(struct timer_of *to)
181+
{
182+
if (to->flags & TIMER_OF_IRQ)
183+
timer_irq_exit(&to->of_irq);
184+
185+
if (to->flags & TIMER_OF_CLOCK)
186+
timer_clk_exit(&to->of_clk);
187+
188+
if (to->flags & TIMER_OF_BASE)
189+
timer_base_exit(&to->of_base);
190+
}

‎drivers/clocksource/timer-of.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,7 @@ static inline unsigned long timer_of_period(struct timer_of *to)
6666

6767
extern int __init timer_of_init(struct device_node *np,
6868
struct timer_of *to);
69+
70+
extern void timer_of_exit(struct timer_of *to);
71+
6972
#endif

0 commit comments

Comments
 (0)