]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mm/ioremap.c
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireles...
[linux-2.6-omap-h63xx.git] / arch / arm / mm / ioremap.c
index f3ade18862aaa8fd8e63488bc3eee36253c4e0f7..303a7ff6bfd2eeb3120164d9cc185e0973d600de 100644 (file)
@@ -162,7 +162,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_vaddr(pmd));
+                               pte_free_kernel(&init_mm, pmd_page_vaddr(pmd));
                }
 
                addr += PGDIR_SIZE;
@@ -280,7 +280,10 @@ __arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
        if (!type)
                return NULL;
 
-       size = PAGE_ALIGN(size);
+       /*
+        * Page align the mapping size, taking account of any offset.
+        */
+       size = PAGE_ALIGN(offset + size);
 
        area = get_vm_area(size, VM_IOREMAP);
        if (!area)
@@ -325,11 +328,6 @@ __arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
        if (!size || last_addr < phys_addr)
                return NULL;
 
-       /*
-        * Page align the mapping size
-        */
-       size = PAGE_ALIGN(last_addr + 1) - phys_addr;
-
        return __arm_ioremap_pfn(pfn, offset, size, mtype);
 }
 EXPORT_SYMBOL(__arm_ioremap);