OSDN Git Service

Merge patch series "riscv: Introduce KASLR"
[tomoyo/tomoyo-test1.git] / mm / ioremap.c
index 68d9895..3e049df 100644 (file)
 #include <linux/mm.h>
 #include <linux/io.h>
 #include <linux/export.h>
-
-/*
- * Ioremap often, but not always uses the generic vmalloc area. E.g on
- * Power ARCH, it could have different ioremap space.
- */
-#ifndef IOREMAP_START
-#define IOREMAP_START   VMALLOC_START
-#define IOREMAP_END     VMALLOC_END
-#endif
+#include <linux/ioremap.h>
 
 void __iomem *generic_ioremap_prot(phys_addr_t phys_addr, size_t size,
                                   pgprot_t prot)
@@ -41,9 +33,6 @@ void __iomem *generic_ioremap_prot(phys_addr_t phys_addr, size_t size,
        phys_addr -= offset;
        size = PAGE_ALIGN(size + offset);
 
-       if (!ioremap_allowed(phys_addr, size, pgprot_val(prot)))
-               return NULL;
-
        area = __get_vm_area_caller(size, VM_IOREMAP, IOREMAP_START,
                                    IOREMAP_END, __builtin_return_address(0));
        if (!area)
@@ -72,9 +61,6 @@ void generic_iounmap(volatile void __iomem *addr)
 {
        void *vaddr = (void *)((unsigned long)addr & PAGE_MASK);
 
-       if (!iounmap_allowed(vaddr))
-               return;
-
        if (is_ioremap_addr(vaddr))
                vunmap(vaddr);
 }