aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/ioremap.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/ioremap.c')
-rw-r--r--arch/x86/mm/ioremap.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 6cd3418afe71..3f7f05e2c434 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -124,6 +124,7 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
124 struct vm_struct *area; 124 struct vm_struct *area;
125 unsigned long new_prot_val; 125 unsigned long new_prot_val;
126 pgprot_t prot; 126 pgprot_t prot;
127 int retval;
127 128
128 /* Don't allow wraparound or zero size */ 129 /* Don't allow wraparound or zero size */
129 last_addr = phys_addr + size - 1; 130 last_addr = phys_addr + size - 1;
@@ -163,8 +164,14 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
163 phys_addr &= PAGE_MASK; 164 phys_addr &= PAGE_MASK;
164 size = PAGE_ALIGN(last_addr+1) - phys_addr; 165 size = PAGE_ALIGN(last_addr+1) - phys_addr;
165 166
166 if (reserve_memtype(phys_addr, phys_addr + size, 167 retval = reserve_memtype(phys_addr, phys_addr + size,
167 prot_val, &new_prot_val)) { 168 prot_val, &new_prot_val);
169 if (retval) {
170 printk("reserve_memtype returned %d\n", retval);
171 return NULL;
172 }
173
174 if (prot_val != new_prot_val) {
168 /* 175 /*
169 * Do not fallback to certain memory types with certain 176 * Do not fallback to certain memory types with certain
170 * requested type: 177 * requested type: