diff options
Diffstat (limited to 'drivers/char/drm/ati_pcigart.c')
-rw-r--r-- | drivers/char/drm/ati_pcigart.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/char/drm/ati_pcigart.c b/drivers/char/drm/ati_pcigart.c index 5485382cadec..bd7be09ea53d 100644 --- a/drivers/char/drm/ati_pcigart.c +++ b/drivers/char/drm/ati_pcigart.c | |||
@@ -59,17 +59,16 @@ static void *drm_ati_alloc_pcigart_table(void) | |||
59 | int i; | 59 | int i; |
60 | DRM_DEBUG("%s\n", __FUNCTION__); | 60 | DRM_DEBUG("%s\n", __FUNCTION__); |
61 | 61 | ||
62 | address = __get_free_pages(GFP_KERNEL, ATI_PCIGART_TABLE_ORDER); | 62 | address = __get_free_pages(GFP_KERNEL | __GFP_COMP, |
63 | ATI_PCIGART_TABLE_ORDER); | ||
63 | if (address == 0UL) { | 64 | if (address == 0UL) { |
64 | return 0; | 65 | return NULL; |
65 | } | 66 | } |
66 | 67 | ||
67 | page = virt_to_page(address); | 68 | page = virt_to_page(address); |
68 | 69 | ||
69 | for (i = 0; i < ATI_PCIGART_TABLE_PAGES; i++, page++) { | 70 | for (i = 0; i < ATI_PCIGART_TABLE_PAGES; i++, page++) |
70 | get_page(page); | ||
71 | SetPageReserved(page); | 71 | SetPageReserved(page); |
72 | } | ||
73 | 72 | ||
74 | DRM_DEBUG("%s: returning 0x%08lx\n", __FUNCTION__, address); | 73 | DRM_DEBUG("%s: returning 0x%08lx\n", __FUNCTION__, address); |
75 | return (void *)address; | 74 | return (void *)address; |
@@ -83,10 +82,8 @@ static void drm_ati_free_pcigart_table(void *address) | |||
83 | 82 | ||
84 | page = virt_to_page((unsigned long)address); | 83 | page = virt_to_page((unsigned long)address); |
85 | 84 | ||
86 | for (i = 0; i < ATI_PCIGART_TABLE_PAGES; i++, page++) { | 85 | for (i = 0; i < ATI_PCIGART_TABLE_PAGES; i++, page++) |
87 | __put_page(page); | ||
88 | ClearPageReserved(page); | 86 | ClearPageReserved(page); |
89 | } | ||
90 | 87 | ||
91 | free_pages((unsigned long)address, ATI_PCIGART_TABLE_ORDER); | 88 | free_pages((unsigned long)address, ATI_PCIGART_TABLE_ORDER); |
92 | } | 89 | } |
@@ -127,7 +124,7 @@ int drm_ati_pcigart_cleanup(drm_device_t *dev, drm_ati_pcigart_info *gart_info) | |||
127 | if (gart_info->gart_table_location == DRM_ATI_GART_MAIN | 124 | if (gart_info->gart_table_location == DRM_ATI_GART_MAIN |
128 | && gart_info->addr) { | 125 | && gart_info->addr) { |
129 | drm_ati_free_pcigart_table(gart_info->addr); | 126 | drm_ati_free_pcigart_table(gart_info->addr); |
130 | gart_info->addr = 0; | 127 | gart_info->addr = NULL; |
131 | } | 128 | } |
132 | 129 | ||
133 | return 1; | 130 | return 1; |
@@ -168,7 +165,7 @@ int drm_ati_pcigart_init(drm_device_t *dev, drm_ati_pcigart_info *gart_info) | |||
168 | if (bus_address == 0) { | 165 | if (bus_address == 0) { |
169 | DRM_ERROR("unable to map PCIGART pages!\n"); | 166 | DRM_ERROR("unable to map PCIGART pages!\n"); |
170 | drm_ati_free_pcigart_table(address); | 167 | drm_ati_free_pcigart_table(address); |
171 | address = 0; | 168 | address = NULL; |
172 | goto done; | 169 | goto done; |
173 | } | 170 | } |
174 | } else { | 171 | } else { |