diff options
author | Tony Lindgren <tony@atomide.com> | 2009-10-19 18:25:22 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-10-19 18:25:22 -0400 |
commit | 986a13f508156e1d041d59166beb2a3dec2ddfad (patch) | |
tree | 58e8c0a6405c9cb42fc13105ffa740813a15c5e8 /arch | |
parent | 9f7065dab5d12b10c1a77134cb1a3f7c5fd17f4f (diff) |
omap: Use ioremap in omap_hwmod.c
Use ioremap in omap_hwmod.c
Acked-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index d2e0f1c95961..8ac8798feb92 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -496,6 +496,7 @@ static void __iomem *_find_mpu_rt_base(struct omap_hwmod *oh, u8 index) | |||
496 | struct omap_hwmod_addr_space *mem; | 496 | struct omap_hwmod_addr_space *mem; |
497 | int i; | 497 | int i; |
498 | int found = 0; | 498 | int found = 0; |
499 | void __iomem *va_start; | ||
499 | 500 | ||
500 | if (!oh || oh->slaves_cnt == 0) | 501 | if (!oh || oh->slaves_cnt == 0) |
501 | return NULL; | 502 | return NULL; |
@@ -509,16 +510,20 @@ static void __iomem *_find_mpu_rt_base(struct omap_hwmod *oh, u8 index) | |||
509 | } | 510 | } |
510 | } | 511 | } |
511 | 512 | ||
512 | /* XXX use ioremap() instead? */ | 513 | if (found) { |
513 | 514 | va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start); | |
514 | if (found) | 515 | if (!va_start) { |
516 | pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name); | ||
517 | return NULL; | ||
518 | } | ||
515 | pr_debug("omap_hwmod: %s: MPU register target at va %p\n", | 519 | pr_debug("omap_hwmod: %s: MPU register target at va %p\n", |
516 | oh->name, OMAP2_IO_ADDRESS(mem->pa_start)); | 520 | oh->name, va_start); |
517 | else | 521 | } else { |
518 | pr_debug("omap_hwmod: %s: no MPU register target found\n", | 522 | pr_debug("omap_hwmod: %s: no MPU register target found\n", |
519 | oh->name); | 523 | oh->name); |
524 | } | ||
520 | 525 | ||
521 | return (found) ? OMAP2_IO_ADDRESS(mem->pa_start) : NULL; | 526 | return (found) ? va_start : NULL; |
522 | } | 527 | } |
523 | 528 | ||
524 | /** | 529 | /** |
@@ -1148,6 +1153,7 @@ int omap_hwmod_unregister(struct omap_hwmod *oh) | |||
1148 | pr_debug("omap_hwmod: %s: unregistering\n", oh->name); | 1153 | pr_debug("omap_hwmod: %s: unregistering\n", oh->name); |
1149 | 1154 | ||
1150 | mutex_lock(&omap_hwmod_mutex); | 1155 | mutex_lock(&omap_hwmod_mutex); |
1156 | iounmap(oh->_rt_va); | ||
1151 | list_del(&oh->node); | 1157 | list_del(&oh->node); |
1152 | mutex_unlock(&omap_hwmod_mutex); | 1158 | mutex_unlock(&omap_hwmod_mutex); |
1153 | 1159 | ||