diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-09-21 05:09:22 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-09-21 05:09:22 -0400 |
commit | 7cce2f4cb7f5f641f78c8e3eea4e7b1b96cb71c0 (patch) | |
tree | b064d077928cf224660ab1e1841cdab2c9fd8b08 /include/linux/io-mapping.h | |
parent | e055f7e873d900925c222cf2d1ec955af4a9ca90 (diff) | |
parent | ebc79c4f8da0f92efa968e0328f32334a2ce80cf (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into linux-next
Conflicts:
fs/ubifs/super.c
Merge the upstream tree in order to resolve a conflict with the
per-bdi writeback changes from the linux-2.6-block tree.
Diffstat (limited to 'include/linux/io-mapping.h')
-rw-r--r-- | include/linux/io-mapping.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 0adb0f91568c..97eb928b4924 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
@@ -49,23 +49,30 @@ static inline struct io_mapping * | |||
49 | io_mapping_create_wc(resource_size_t base, unsigned long size) | 49 | io_mapping_create_wc(resource_size_t base, unsigned long size) |
50 | { | 50 | { |
51 | struct io_mapping *iomap; | 51 | struct io_mapping *iomap; |
52 | 52 | pgprot_t prot; | |
53 | if (!is_io_mapping_possible(base, size)) | ||
54 | return NULL; | ||
55 | 53 | ||
56 | iomap = kmalloc(sizeof(*iomap), GFP_KERNEL); | 54 | iomap = kmalloc(sizeof(*iomap), GFP_KERNEL); |
57 | if (!iomap) | 55 | if (!iomap) |
58 | return NULL; | 56 | goto out_err; |
57 | |||
58 | if (iomap_create_wc(base, size, &prot)) | ||
59 | goto out_free; | ||
59 | 60 | ||
60 | iomap->base = base; | 61 | iomap->base = base; |
61 | iomap->size = size; | 62 | iomap->size = size; |
62 | iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL)); | 63 | iomap->prot = prot; |
63 | return iomap; | 64 | return iomap; |
65 | |||
66 | out_free: | ||
67 | kfree(iomap); | ||
68 | out_err: | ||
69 | return NULL; | ||
64 | } | 70 | } |
65 | 71 | ||
66 | static inline void | 72 | static inline void |
67 | io_mapping_free(struct io_mapping *mapping) | 73 | io_mapping_free(struct io_mapping *mapping) |
68 | { | 74 | { |
75 | iomap_free(mapping->base, mapping->size); | ||
69 | kfree(mapping); | 76 | kfree(mapping); |
70 | } | 77 | } |
71 | 78 | ||