x86: ioremap, remove WARN_ON()
[sfrench/cifs-2.6.git] / arch / x86 / mm / ioremap.c
index 882328efc3dbab30920cfa041892f1e877be9a50..8fe576baa14870c225f00606c84967d2941defe8 100644 (file)
@@ -134,8 +134,6 @@ static void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
                        return NULL;
        }
 
-       WARN_ON_ONCE(page_is_ram(pfn));
-
        switch (mode) {
        case IOR_MODE_UNCACHED:
        default:
@@ -162,7 +160,7 @@ static void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
        area->phys_addr = phys_addr;
        vaddr = (unsigned long) area->addr;
        if (ioremap_page_range(vaddr, vaddr + size, phys_addr, prot)) {
-               remove_vm_area((void *)(vaddr & PAGE_MASK));
+               free_vm_area(area);
                return NULL;
        }