summaryrefslogtreecommitdiff
path: root/arch/arm/mm/mmap.c
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmerdabbelt@google.com>2020-07-09 12:00:10 -0700
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-12-11 12:28:24 -0800
commit914ee96654d87abc548bdd44ad9e4b3a14173cac (patch)
treeea7443fc7892f4e2ca5a13a87721974376a408f4 /arch/arm/mm/mmap.c
parent78ed473c76192ab7b8e96c5948cca82db4c744fe (diff)
arm: Use the generic devmem_is_allowed()
This is exactly the same as the arm64 version, which I recently copied into lib/ for use by the RISC-V port. Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/arm/mm/mmap.c')
-rw-r--r--arch/arm/mm/mmap.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index b8d912ac9e61..a0f8a0ca0788 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -165,25 +165,3 @@ int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
{
return (pfn + (size >> PAGE_SHIFT)) <= (1 + (PHYS_MASK >> PAGE_SHIFT));
}
-
-#ifdef CONFIG_STRICT_DEVMEM
-
-#include <linux/ioport.h>
-
-/*
- * devmem_is_allowed() checks to see if /dev/mem access to a certain
- * address is valid. The argument is a physical page number.
- * We mimic x86 here by disallowing access to system RAM as well as
- * device-exclusive MMIO regions. This effectively disable read()/write()
- * on /dev/mem.
- */
-int devmem_is_allowed(unsigned long pfn)
-{
- if (iomem_is_exclusive(pfn << PAGE_SHIFT))
- return 0;
- if (!page_is_ram(pfn))
- return 1;
- return 0;
-}
-
-#endif