linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: benjamin.gaignard@linaro.org (Benjamin Gaignard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 1/5] timer: add timer_of_deinit function
Date: Wed, 18 Oct 2017 14:58:22 +0200	[thread overview]
Message-ID: <1508331506-23782-2-git-send-email-benjamin.gaignard@linaro.org> (raw)
In-Reply-To: <1508331506-23782-1-git-send-email-benjamin.gaignard@linaro.org>

Add this deinit function to be able to undo what have been done
in timer_of_init().

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
---
 drivers/clocksource/timer-of.c | 12 ++++++++++++
 drivers/clocksource/timer-of.h |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c
index c79122d..14404a0 100644
--- a/drivers/clocksource/timer-of.c
+++ b/drivers/clocksource/timer-of.c
@@ -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_deinit(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 e0d7272..3833ab1 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_deinit(struct timer_of *to);
+
 #endif
-- 
2.7.4

  reply	other threads:[~2017-10-18 12:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 12:58 [PATCH v6 0/5] stm32 clocksource driver rework Benjamin Gaignard
2017-10-18 12:58 ` Benjamin Gaignard [this message]
2017-10-18 12:58 ` [PATCH v6 2/5] clocksource: stm32: convert driver to timer_of Benjamin Gaignard
2017-10-18 18:31   ` Thomas Gleixner
2017-10-18 19:32     ` Benjamin Gaignard
2017-10-19  9:07       ` Daniel Lezcano
2017-10-18 12:58 ` [PATCH v6 3/5] clocksource: stm32: only use 32 bits timers Benjamin Gaignard
2017-10-18 18:35   ` Thomas Gleixner
2017-10-18 12:58 ` [PATCH v6 4/5] clocksource: stm32: add clocksource support Benjamin Gaignard
2017-10-18 18:59   ` Thomas Gleixner
2017-10-19  8:06     ` Benjamin Gaignard
2017-10-19  8:18       ` Thomas Gleixner
2017-10-18 12:58 ` [PATCH v6 5/5] arm: dts: stm32: remove useless clocksource nodes Benjamin Gaignard
2017-10-18 13:21   ` Rob Herring
2017-10-18 13:38     ` Benjamin Gaignard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1508331506-23782-2-git-send-email-benjamin.gaignard@linaro.org \
    --to=benjamin.gaignard@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).