[PATCH 6/7] ARM: OMAP2+: timer: use a proper interface to get hwmod data

Paul Walmsley paul at pwsan.com
Mon Jan 30 05:18:18 EST 2012


arch/arm/mach-omap2/timer.c pokes around inside the hwmod data
structures.  Since the hwmod data structures are about to change, this
code will break.  This patch modifies the timer code to use
recently-added hwmod functions instead.

Signed-off-by: Paul Walmsley <paul at pwsan.com>
Cc: Tony Lindgren <tony at atomide.com>
---
 arch/arm/mach-omap2/timer.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 6eeff0e..499d884 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -145,6 +145,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
 {
 	char name[10]; /* 10 = sizeof("gptXX_Xck0") */
 	struct omap_hwmod *oh;
+	u32 pa_start, pa_end;
 	size_t size;
 	int res = 0;
 
@@ -154,9 +155,10 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
 	if (!oh)
 		return -ENODEV;
 
-	timer->irq = oh->mpu_irqs[0].irq;
-	timer->phys_base = oh->slaves[0]->addr->pa_start;
-	size = oh->slaves[0]->addr->pa_end - timer->phys_base;
+	timer->irq = omap_hwmod_get_mpu_irq(oh);
+	omap_hwmod_get_mpu_rt_pa(oh, &pa_start, &pa_end);
+	timer->phys_base = pa_start;
+	size = pa_end - pa_start;
 
 	/* Static mapping, never released */
 	timer->io_base = ioremap(timer->phys_base, size);





More information about the linux-arm-kernel mailing list