summaryrefslogtreecommitdiff
path: root/arch/sh/mm/ioremap_32.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-18 20:42:39 +0900
committerPaul Mundt <lethal@linux-sh.org>2010-01-18 20:42:39 +0900
commit8faba6121566248330e738d25a2c43d7500fb9f0 (patch)
tree9cb09b2ec00b504dd24e1272126a22cd365e7282 /arch/sh/mm/ioremap_32.c
parent4291b730cd0f0cf98a90d946b6cabbd804397350 (diff)
parent78bf04fc96f509474c6b443b515d6b79bb7bf584 (diff)
Merge branch 'sh/ioremap-fixed'
Diffstat (limited to 'arch/sh/mm/ioremap_32.c')
-rw-r--r--arch/sh/mm/ioremap_32.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/arch/sh/mm/ioremap_32.c b/arch/sh/mm/ioremap_32.c
index 2141befb4f91..c80a8166fbb0 100644
--- a/arch/sh/mm/ioremap_32.c
+++ b/arch/sh/mm/ioremap_32.c
@@ -105,15 +105,35 @@ void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size,
}
EXPORT_SYMBOL(__ioremap_caller);
+/*
+ * Simple checks for non-translatable mappings.
+ */
+static inline int iomapping_nontranslatable(unsigned long offset)
+{
+#ifdef CONFIG_29BIT
+ /*
+ * In 29-bit mode this includes the fixed P1/P2 areas, as well as
+ * parts of P3.
+ */
+ if (PXSEG(offset) < P3SEG || offset >= P3_ADDR_MAX)
+ return 1;
+#endif
+
+ if (is_pci_memory_fixed_range(offset, 0))
+ return 1;
+
+ return 0;
+}
+
void __iounmap(void __iomem *addr)
{
unsigned long vaddr = (unsigned long __force)addr;
- unsigned long seg = PXSEG(vaddr);
struct vm_struct *p;
- if (seg < P3SEG || vaddr >= P3_ADDR_MAX)
- return;
- if (is_pci_memory_fixed_range(vaddr, 0))
+ /*
+ * Nothing to do if there is no translatable mapping.
+ */
+ if (iomapping_nontranslatable(vaddr))
return;
#ifdef CONFIG_PMB