diff options
author | Wang, Yalin <Yalin.Wang@sonymobile.com> | 2015-01-28 00:57:34 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-01-28 21:37:41 -0500 |
commit | e410055331c2f474872b364dce3d4042418e892b (patch) | |
tree | b1ee0e24726b8da7b5451533fdd20986c01db883 /drivers/char/agp | |
parent | b3869b17fd63bacb53ac4db4ff4ba093701e17be (diff) |
agp: change agp_free_page_array to use kvfree
Change agp_free_page_array to use kvfree function,
remove the duplicated code.
Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char/agp')
-rw-r--r-- | drivers/char/agp/agp.h | 5 | ||||
-rw-r--r-- | drivers/char/agp/generic.c | 11 |
2 files changed, 4 insertions, 12 deletions
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h index b709749c8639..4eb1c772ded7 100644 --- a/drivers/char/agp/agp.h +++ b/drivers/char/agp/agp.h | |||
@@ -219,7 +219,10 @@ struct agp_bridge_data *agp_generic_find_bridge(struct pci_dev *pdev); | |||
219 | /* generic functions for user-populated AGP memory types */ | 219 | /* generic functions for user-populated AGP memory types */ |
220 | struct agp_memory *agp_generic_alloc_user(size_t page_count, int type); | 220 | struct agp_memory *agp_generic_alloc_user(size_t page_count, int type); |
221 | void agp_alloc_page_array(size_t size, struct agp_memory *mem); | 221 | void agp_alloc_page_array(size_t size, struct agp_memory *mem); |
222 | void agp_free_page_array(struct agp_memory *mem); | 222 | static inline void agp_free_page_array(struct agp_memory *mem) |
223 | { | ||
224 | kvfree(mem->pages); | ||
225 | } | ||
223 | 226 | ||
224 | 227 | ||
225 | /* generic routines for agp>=3 */ | 228 | /* generic routines for agp>=3 */ |
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index 0fbccce1cee9..f002fa5d1887 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c | |||
@@ -98,17 +98,6 @@ void agp_alloc_page_array(size_t size, struct agp_memory *mem) | |||
98 | } | 98 | } |
99 | EXPORT_SYMBOL(agp_alloc_page_array); | 99 | EXPORT_SYMBOL(agp_alloc_page_array); |
100 | 100 | ||
101 | void agp_free_page_array(struct agp_memory *mem) | ||
102 | { | ||
103 | if (is_vmalloc_addr(mem->pages)) { | ||
104 | vfree(mem->pages); | ||
105 | } else { | ||
106 | kfree(mem->pages); | ||
107 | } | ||
108 | } | ||
109 | EXPORT_SYMBOL(agp_free_page_array); | ||
110 | |||
111 | |||
112 | static struct agp_memory *agp_create_user_memory(unsigned long num_agp_pages) | 101 | static struct agp_memory *agp_create_user_memory(unsigned long num_agp_pages) |
113 | { | 102 | { |
114 | struct agp_memory *new; | 103 | struct agp_memory *new; |