Commit e4100553 authored by Wang, Yalin's avatar Wang, Yalin Committed by Dave Airlie

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: default avatarYalin Wang <yalin.wang@sonymobile.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent b3869b17
...@@ -219,7 +219,10 @@ struct agp_bridge_data *agp_generic_find_bridge(struct pci_dev *pdev); ...@@ -219,7 +219,10 @@ struct agp_bridge_data *agp_generic_find_bridge(struct pci_dev *pdev);
/* generic functions for user-populated AGP memory types */ /* generic functions for user-populated AGP memory types */
struct agp_memory *agp_generic_alloc_user(size_t page_count, int type); struct agp_memory *agp_generic_alloc_user(size_t page_count, int type);
void agp_alloc_page_array(size_t size, struct agp_memory *mem); void agp_alloc_page_array(size_t size, struct agp_memory *mem);
void agp_free_page_array(struct agp_memory *mem); static inline void agp_free_page_array(struct agp_memory *mem)
{
kvfree(mem->pages);
}
/* generic routines for agp>=3 */ /* generic routines for agp>=3 */
......
...@@ -98,17 +98,6 @@ void agp_alloc_page_array(size_t size, struct agp_memory *mem) ...@@ -98,17 +98,6 @@ void agp_alloc_page_array(size_t size, struct agp_memory *mem)
} }
EXPORT_SYMBOL(agp_alloc_page_array); EXPORT_SYMBOL(agp_alloc_page_array);
void agp_free_page_array(struct agp_memory *mem)
{
if (is_vmalloc_addr(mem->pages)) {
vfree(mem->pages);
} else {
kfree(mem->pages);
}
}
EXPORT_SYMBOL(agp_free_page_array);
static struct agp_memory *agp_create_user_memory(unsigned long num_agp_pages) static struct agp_memory *agp_create_user_memory(unsigned long num_agp_pages)
{ {
struct agp_memory *new; struct agp_memory *new;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment