linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 12/15] ARM: smp_twd: remove old local timer interface
Date: Fri, 13 Jan 2012 18:28:39 +0000	[thread overview]
Message-ID: <1326479322-6033-13-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1326479322-6033-1-git-send-email-marc.zyngier@arm.com>

Now that all users of the previous local timer interface
have been converted to the runtime registration API, make
this interface the only one supported for this driver.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/include/asm/localtimer.h |    8 --------
 arch/arm/include/asm/smp_twd.h    |    6 ------
 arch/arm/kernel/smp_twd.c         |   34 +++++-----------------------------
 3 files changed, 5 insertions(+), 43 deletions(-)

diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
index f088d63..955eed1 100644
--- a/arch/arm/include/asm/localtimer.h
+++ b/arch/arm/include/asm/localtimer.h
@@ -11,7 +11,6 @@
 #define __ASM_ARM_LOCALTIMER_H
 
 #include <linux/errno.h>
-#include <linux/interrupt.h>
 
 struct clock_event_device;
 
@@ -26,13 +25,6 @@ struct local_timer_ops {
 void percpu_timer_setup(void);
 
 #ifdef CONFIG_LOCAL_TIMERS
-
-#ifdef CONFIG_HAVE_ARM_TWD
-
-#include "smp_twd.h"
-
-#endif
-
 /*
  * Stop the local timer
  */
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
index cfa6f30..ff5c994 100644
--- a/arch/arm/include/asm/smp_twd.h
+++ b/arch/arm/include/asm/smp_twd.h
@@ -20,12 +20,6 @@
 
 #include <linux/ioport.h>
 
-struct clock_event_device;
-
-extern void __iomem *twd_base;
-
-int twd_timer_setup(struct clock_event_device *);
-
 struct twd_local_timer {
 	struct resource	res[2];
 };
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index a676f14..0feb728 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -18,7 +18,7 @@
 #include <linux/smp.h>
 #include <linux/jiffies.h>
 #include <linux/clockchips.h>
-#include <linux/irq.h>
+#include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
@@ -28,7 +28,7 @@
 #include <asm/hardware/gic.h>
 
 /* set up by the platform code */
-void __iomem *twd_base;
+static void __iomem *twd_base;
 
 static struct clk *twd_clk;
 static unsigned long twd_timer_rate;
@@ -80,7 +80,7 @@ static int twd_set_next_event(unsigned long evt,
  * If a local timer interrupt has occurred, acknowledge and return 1.
  * Otherwise, return 0.
  */
-int twd_timer_ack(void)
+static int twd_timer_ack(void)
 {
 	if (__raw_readl(twd_base + TWD_TIMER_INTSTAT)) {
 		__raw_writel(1, twd_base + TWD_TIMER_INTSTAT);
@@ -96,11 +96,6 @@ static void twd_timer_stop(struct clock_event_device *clk)
 	disable_percpu_irq(clk->irq);
 }
 
-/* Temporary hack to be removed when all TWD users are converted to
-   the new registration interface */
-void local_timer_stop(struct clock_event_device *clk)
-	__attribute__ ((alias ("twd_timer_stop")));
-
 #ifdef CONFIG_CPU_FREQ
 
 /*
@@ -230,28 +225,10 @@ static struct clk *twd_get_clock(void)
 /*
  * Setup the local clock events for a CPU.
  */
-int __cpuinit twd_timer_setup(struct clock_event_device *clk)
+static int __cpuinit twd_timer_setup(struct clock_event_device *clk)
 {
 	struct clock_event_device **this_cpu_clk;
 
-	if (!twd_evt) {
-		int err;
-
-		twd_evt = alloc_percpu(struct clock_event_device *);
-		if (!twd_evt) {
-			pr_err("twd: can't allocate memory\n");
-			return -ENOMEM;
-		}
-
-		err = request_percpu_irq(clk->irq, twd_handler,
-					 "twd", twd_evt);
-		if (err) {
-			pr_err("twd: can't register interrupt %d (%d)\n",
-			       clk->irq, err);
-			return err;
-		}
-	}
-
 	if (!twd_clk)
 		twd_clk = twd_get_clock();
 
@@ -266,8 +243,7 @@ int __cpuinit twd_timer_setup(struct clock_event_device *clk)
 	clk->rating = 350;
 	clk->set_mode = twd_set_mode;
 	clk->set_next_event = twd_set_next_event;
-	if (!clk->irq)
-		clk->irq = twd_ppi;
+	clk->irq = twd_ppi;
 
 	this_cpu_clk = __this_cpu_ptr(twd_evt);
 	*this_cpu_clk = clk;
-- 
1.7.7.1

  parent reply	other threads:[~2012-01-13 18:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 18:28 [PATCH v2 00/15] Runtime registration for local timers Marc Zyngier
2012-01-13 18:28 ` [PATCH v2 01/15] ARM: smp_twd: make local_timer_stop a symbol instead of a #define Marc Zyngier
2012-01-13 18:28 ` [PATCH v2 02/15] ARM: local timers: introduce a new registration interface Marc Zyngier
2012-01-13 18:28 ` [PATCH v2 03/15] ARM: smp_twd: add runtime registration support Marc Zyngier
2012-01-13 18:28 ` [PATCH v2 04/15] ARM: smp_twd: add device tree support Marc Zyngier
2012-01-13 18:28 ` [PATCH v2 05/15] ARM: OMAP4: convert to twd_local_timer_register() interface Marc Zyngier
2012-01-13 18:28 ` [PATCH v2 06/15] ARM: plat-versatile: " Marc Zyngier
2012-01-13 18:28 ` [PATCH v2 07/15] ARM: tegra: " Marc Zyngier
2012-01-13 18:28 ` [PATCH v2 08/15] ARM: shmobile: " Marc Zyngier
2012-01-13 18:28 ` [PATCH v2 09/15] ARM: ux500: " Marc Zyngier
2012-01-13 18:28 ` [PATCH v2 10/15] ARM: highbank: " Marc Zyngier
2012-01-13 19:07   ` Rob Herring
2012-01-14  2:41     ` Shawn Guo
2012-01-14  8:46       ` Russell King - ARM Linux
2012-01-14 15:06       ` Rob Herring
2012-01-13 18:28 ` [PATCH v2 11/15] ARM: imx6q: " Marc Zyngier
2012-01-14  2:47   ` Shawn Guo
2012-01-13 18:28 ` Marc Zyngier [this message]
2012-01-13 18:28 ` [PATCH v2 13/15] ARM: local timers: convert exynos to runtime registration interface Marc Zyngier
2012-01-13 23:29   ` David Brown
2012-01-13 18:28 ` [PATCH v2 14/15] ARM: local timers: convert MSM " Marc Zyngier
2012-01-13 22:37   ` David Brown
2012-01-13 22:47     ` Russell King - ARM Linux
2012-01-13 23:33       ` David Brown
2012-01-13 23:26   ` David Brown
2012-01-13 23:29     ` Russell King - ARM Linux
2012-01-14 16:27       ` Marc Zyngier
2012-01-13 18:28 ` [PATCH v2 15/15] ARM: local timers: make the runtime registration interface mandatory Marc Zyngier

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=1326479322-6033-13-git-send-email-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --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).