2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 20:53:53 +08:00

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>
This commit is contained in:
Tony Lindgren 2009-10-19 15:25:22 -07:00
parent 9f7065dab5
commit 986a13f508

View File

@ -496,6 +496,7 @@ static void __iomem *_find_mpu_rt_base(struct omap_hwmod *oh, u8 index)
struct omap_hwmod_addr_space *mem; struct omap_hwmod_addr_space *mem;
int i; int i;
int found = 0; int found = 0;
void __iomem *va_start;
if (!oh || oh->slaves_cnt == 0) if (!oh || oh->slaves_cnt == 0)
return NULL; return NULL;
@ -509,16 +510,20 @@ static void __iomem *_find_mpu_rt_base(struct omap_hwmod *oh, u8 index)
} }
} }
/* XXX use ioremap() instead? */ if (found) {
va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
if (found) if (!va_start) {
pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name);
return NULL;
}
pr_debug("omap_hwmod: %s: MPU register target at va %p\n", pr_debug("omap_hwmod: %s: MPU register target at va %p\n",
oh->name, OMAP2_IO_ADDRESS(mem->pa_start)); oh->name, va_start);
else } else {
pr_debug("omap_hwmod: %s: no MPU register target found\n", pr_debug("omap_hwmod: %s: no MPU register target found\n",
oh->name); oh->name);
}
return (found) ? OMAP2_IO_ADDRESS(mem->pa_start) : NULL; return (found) ? va_start : NULL;
} }
/** /**
@ -1148,6 +1153,7 @@ int omap_hwmod_unregister(struct omap_hwmod *oh)
pr_debug("omap_hwmod: %s: unregistering\n", oh->name); pr_debug("omap_hwmod: %s: unregistering\n", oh->name);
mutex_lock(&omap_hwmod_mutex); mutex_lock(&omap_hwmod_mutex);
iounmap(oh->_rt_va);
list_del(&oh->node); list_del(&oh->node);
mutex_unlock(&omap_hwmod_mutex); mutex_unlock(&omap_hwmod_mutex);