summaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/ioremap_fixed.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-19 13:49:19 +0900
committerPaul Mundt <lethal@linux-sh.org>2010-01-19 13:49:19 +0900
commitacf2c9685fb8295cb62a623d7358a1cfde8b07ea (patch)
tree417313447aa8da946c74a5afcf1085c7b1744fb6 /arch/sh/mm/ioremap_fixed.c
parentd57d64080ddc0ff13fcffc898b6251074a482ba1 (diff)
sh: Kill off duplicate address alignment in ioremap_fixed().
This is already taken care of in the top-level ioremap, and now that no one should be calling ioremap_fixed() directly we can simply throw the mapping displacement in as an additional argument. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/ioremap_fixed.c')
-rw-r--r--arch/sh/mm/ioremap_fixed.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/arch/sh/mm/ioremap_fixed.c b/arch/sh/mm/ioremap_fixed.c
index 425f6c6bf25..551b513e8fc 100644
--- a/arch/sh/mm/ioremap_fixed.c
+++ b/arch/sh/mm/ioremap_fixed.c
@@ -45,12 +45,11 @@ void __init ioremap_fixed_init(void)
}
void __init __iomem *
-ioremap_fixed(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
+ioremap_fixed(resource_size_t phys_addr, unsigned long offset,
+ unsigned long size, pgprot_t prot)
{
enum fixed_addresses idx0, idx;
- resource_size_t last_addr;
struct ioremap_map *map;
- unsigned long offset;
unsigned int nrpages;
int i, slot;
@@ -67,18 +66,6 @@ ioremap_fixed(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
if (slot < 0)
return NULL;
- /* Don't allow wraparound or zero size */
- last_addr = phys_addr + size - 1;
- if (!size || last_addr < phys_addr)
- return NULL;
-
- /*
- * Fixmap mappings have to be page-aligned
- */
- offset = phys_addr & ~PAGE_MASK;
- phys_addr &= PAGE_MASK;
- size = PAGE_ALIGN(last_addr + 1) - phys_addr;
-
/*
* Mappings have to fit in the FIX_IOREMAP area.
*/
@@ -111,7 +98,6 @@ int iounmap_fixed(void __iomem *addr)
unsigned long offset;
unsigned int nrpages;
int i, slot;
- pgprot_t prot;
slot = -1;
for (i = 0; i < FIX_N_IOREMAPS; i++) {
@@ -133,11 +119,9 @@ int iounmap_fixed(void __iomem *addr)
offset = virt_addr & ~PAGE_MASK;
nrpages = PAGE_ALIGN(offset + map->size - 1) >> PAGE_SHIFT;
- pgprot_val(prot) = _PAGE_WIRED;
-
idx = FIX_IOREMAP_BEGIN + slot + nrpages;
while (nrpages > 0) {
- __clear_fixmap(idx, prot);
+ __clear_fixmap(idx, __pgprot(_PAGE_WIRED));
--idx;
--nrpages;
}