]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mm/ioremap.c
Merge branch 'master' into upstream-fixes
[linux-2.6-omap-h63xx.git] / arch / arm / mm / ioremap.c
index 7eac87f05180682ea45f3db06c0bdfe59e7739f1..46544059279132efb3b3112f95929912f700f004 100644 (file)
@@ -177,7 +177,7 @@ static void unmap_area_sections(unsigned long virt, unsigned long size)
                         * Free the page table, if there was one.
                         */
                        if ((pmd_val(pmd) & PMD_TYPE_MASK) == PMD_TYPE_TABLE)
-                               pte_free_kernel(pmd_page_kernel(pmd));
+                               pte_free_kernel(pmd_page_vaddr(pmd));
                }
 
                addr += PGDIR_SIZE;
@@ -303,7 +303,6 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
        int err;
        unsigned long addr;
        struct vm_struct * area;
-       unsigned int cr = get_cr();
 
        /*
         * High mappings must be supersection aligned
@@ -317,7 +316,7 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
        addr = (unsigned long)area->addr;
 
 #ifndef CONFIG_SMP
-       if ((((cpu_architecture() >= CPU_ARCH_ARMv6) && (cr & CR_XP)) ||
+       if ((((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
               cpu_is_xsc3()) &&
               !((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) {
                area->flags |= VM_ARM_SECTION_MAPPING;
@@ -362,13 +361,16 @@ __ioremap(unsigned long phys_addr, size_t size, unsigned long flags)
 }
 EXPORT_SYMBOL(__ioremap);
 
-void __iounmap(void __iomem *addr)
+void __iounmap(volatile void __iomem *addr)
 {
+#ifndef CONFIG_SMP
        struct vm_struct **p, *tmp;
+#endif
        unsigned int section_mapping = 0;
 
-       addr = (void __iomem *)(PAGE_MASK & (unsigned long)addr);
+       addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long)addr);
 
+#ifndef CONFIG_SMP
        /*
         * If this is a section based mapping we need to handle it
         * specially as the VM subysystem does not know how to handle
@@ -390,8 +392,9 @@ void __iounmap(void __iomem *addr)
                }
        }
        write_unlock(&vmlist_lock);
+#endif
 
        if (!section_mapping)
-               vunmap(addr);
+               vunmap((void __force *)addr);
 }
 EXPORT_SYMBOL(__iounmap);