aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/io-mapping.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/io-mapping.h')
-rw-r--r--include/linux/io-mapping.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index f1ed66c43787..cbc2f0cd631b 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -49,9 +49,8 @@ static inline struct io_mapping *
49io_mapping_create_wc(resource_size_t base, unsigned long size) 49io_mapping_create_wc(resource_size_t base, unsigned long size)
50{ 50{
51 struct io_mapping *iomap; 51 struct io_mapping *iomap;
52 pgprot_t prot;
53 52
54 if (!reserve_io_memtype_wc(base, size, &prot)) 53 if (!is_io_mapping_possible(base, size))
55 return NULL; 54 return NULL;
56 55
57 iomap = kmalloc(sizeof(*iomap), GFP_KERNEL); 56 iomap = kmalloc(sizeof(*iomap), GFP_KERNEL);
@@ -60,14 +59,13 @@ io_mapping_create_wc(resource_size_t base, unsigned long size)
60 59
61 iomap->base = base; 60 iomap->base = base;
62 iomap->size = size; 61 iomap->size = size;
63 iomap->prot = prot; 62 iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL));
64 return iomap; 63 return iomap;
65} 64}
66 65
67static inline void 66static inline void
68io_mapping_free(struct io_mapping *mapping) 67io_mapping_free(struct io_mapping *mapping)
69{ 68{
70 free_io_memtype(mapping->base, mapping->size);
71 kfree(mapping); 69 kfree(mapping);
72} 70}
73 71