summaryrefslogtreecommitdiff
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>2017-10-23 12:58:37 +0300
committerDaniel Lezcano <daniel.lezcano@linaro.org>2017-10-29 21:05:49 +0300
commitf48729a999ee57b9e831245779e68200dd2bde09 (patch)
tree2bf773cdd0a33892ba33890e968d927e97fb65c6 /drivers/clocksource
parentf16ff2bdb135e2eb35488264006b575c476ea597 (diff)
downloadlinux-f48729a999ee57b9e831245779e68200dd2bde09.tar.xz
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>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/timer-of.c12
-rw-r--r--drivers/clocksource/timer-of.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c
index c79122d8e10d..7c64a5c1bfc1 100644
--- a/drivers/clocksource/timer-of.c
+++ b/drivers/clocksource/timer-of.c
@@ -176,3 +176,15 @@ out_fail:
timer_base_exit(&to->of_base);
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);
+}
diff --git a/drivers/clocksource/timer-of.h b/drivers/clocksource/timer-of.h
index e0d727255f72..44f57e02725d 100644
--- a/drivers/clocksource/timer-of.h
+++ b/drivers/clocksource/timer-of.h
@@ -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,
struct timer_of *to);
+
+extern void timer_of_exit(struct timer_of *to);
+
#endif