提交 f48729a9 编写于 作者: B Benjamin Gaignard 提交者: Daniel Lezcano

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: NBenjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
上级 f16ff2bd
...@@ -176,3 +176,15 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to) ...@@ -176,3 +176,15 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to)
timer_base_exit(&to->of_base); timer_base_exit(&to->of_base);
return ret; return ret;
} }
void timer_of_exit(struct timer_of *to)
{
if (to->flags & TIMER_OF_IRQ)
timer_irq_exit(&to->of_irq);
if (to->flags & TIMER_OF_CLOCK)
timer_clk_exit(&to->of_clk);
if (to->flags & TIMER_OF_BASE)
timer_base_exit(&to->of_base);
}
...@@ -66,4 +66,7 @@ static inline unsigned long timer_of_period(struct timer_of *to) ...@@ -66,4 +66,7 @@ static inline unsigned long timer_of_period(struct timer_of *to)
extern int __init timer_of_init(struct device_node *np, extern int __init timer_of_init(struct device_node *np,
struct timer_of *to); struct timer_of *to);
extern void timer_of_exit(struct timer_of *to);
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册