]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clocksource/drivers/timer-of: Add timer_of_exit function
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>
Mon, 23 Oct 2017 09:58:37 +0000 (11:58 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Sun, 29 Oct 2017 18:05:49 +0000 (19:05 +0100)
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>
drivers/clocksource/timer-of.c
drivers/clocksource/timer-of.h

index c79122d8e10d0b9abd8f5428ceb00d049fa20d05..7c64a5c1bfc13bb536bdefc1f3dab53273e315fb 100644 (file)
@@ -176,3 +176,15 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to)
                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);
+}
index e0d727255f728d6b3dddc60f57c8d733e913629a..44f57e02725d26bdc3960ec4aed9d73dc80ed239 100644 (file)
@@ -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