devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Gaignard <benjamin.gaignard@linaro.org>
To: robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk,
	mcoquelin.stm32@gmail.com, alexandre.torgue@st.com,
	daniel.lezcano@linaro.org, tglx@linutronix.de,
	ludovic.barre@st.com, julien.thierry@arm.com
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>
Subject: [PATCH v7 1/6] timer: add timer_of_exit function
Date: Mon, 23 Oct 2017 11:58:37 +0200	[thread overview]
Message-ID: <1508752722-4489-2-git-send-email-benjamin.gaignard@linaro.org> (raw)
In-Reply-To: <1508752722-4489-1-git-send-email-benjamin.gaignard@linaro.org>

Add this exit 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..7c64a5c1 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_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 e0d7272..44f57e0 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
-- 
2.7.4

  reply	other threads:[~2017-10-23  9:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23  9:58 [PATCH v7 0/6] stm32 clocksource driver rework Benjamin Gaignard
2017-10-23  9:58 ` Benjamin Gaignard [this message]
2017-10-25  8:37   ` [PATCH v7 1/6] timer: add timer_of_exit function Daniel Lezcano
2017-10-23  9:58 ` [PATCH v7 2/6] clocksource: stm32: convert driver to timer_of Benjamin Gaignard
     [not found] ` <1508752722-4489-1-git-send-email-benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-10-23  9:58   ` [PATCH v7 3/6] clocksource: stm32: increase min delta value Benjamin Gaignard
2017-10-23  9:58   ` [PATCH v7 4/6] clocksource: stm32: only use 32 bits timers Benjamin Gaignard
2017-11-07 10:16   ` [PATCH v7 0/6] stm32 clocksource driver rework Benjamin Gaignard
2017-10-23  9:58 ` [PATCH v7 5/6] clocksource: stm32: add clocksource support Benjamin Gaignard
2017-10-23  9:58 ` [PATCH v7 6/6] arm: dts: stm32: remove useless clocksource nodes 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=1508752722-4489-2-git-send-email-benjamin.gaignard@linaro.org \
    --to=benjamin.gaignard@linaro.org \
    --cc=alexandre.torgue@st.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=julien.thierry@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=ludovic.barre@st.com \
    --cc=mark.rutland@arm.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    /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).