Lines Matching refs:new
122 struct agp_memory *new;
125 new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL);
126 if (new == NULL)
129 new->key = agp_get_key();
131 if (new->key < 0) {
132 kfree(new);
136 agp_alloc_page_array(alloc_size, new);
138 if (new->pages == NULL) {
139 agp_free_key(new->key);
140 kfree(new);
143 new->num_scratch_pages = 0;
144 return new;
149 struct agp_memory *new;
151 new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL);
152 if (new == NULL)
155 new->key = agp_get_key();
157 if (new->key < 0) {
158 kfree(new);
162 agp_alloc_page_array(PAGE_SIZE * scratch_pages, new);
164 if (new->pages == NULL) {
165 agp_free_key(new->key);
166 kfree(new);
169 new->num_scratch_pages = scratch_pages;
170 new->type = AGP_NORMAL_MEMORY;
171 return new;
242 struct agp_memory *new;
252 new = agp_generic_alloc_user(page_count, type);
253 if (new)
254 new->bridge = bridge;
255 return new;
259 new = bridge->driver->alloc_by_type(page_count, type);
260 if (new)
261 new->bridge = bridge;
262 return new;
267 new = agp_create_memory(scratch_pages);
269 if (new == NULL)
273 if (bridge->driver->agp_alloc_pages(bridge, new, page_count)) {
274 agp_free_memory(new);
277 new->bridge = bridge;
278 return new;
285 agp_free_memory(new);
288 new->pages[i] = page;
289 new->page_count++;
291 new->bridge = bridge;
293 return new;
1204 struct agp_memory *new;
1209 new = agp_create_user_memory(page_count);
1210 if (new == NULL)
1214 new->pages[i] = NULL;
1215 new->page_count = 0;
1216 new->type = type;
1217 new->num_scratch_pages = pages;
1219 return new;