@@ -303,13 +303,15 @@ static void amd_irongate_tlbflush(struct agp_memory *temp)
static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type)
{
+ struct agp_bridge_data *bridge = mem->bridge;
int i, j, num_entries;
unsigned long __iomem *cur_gatt;
unsigned long addr;
num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries;
- if (type != 0 || mem->type != 0)
+ if (!bridge || type != mem->type ||
+ bridge->driver->agp_type_to_mask_type(bridge, type))
return -EINVAL;
if ((pg_start + mem->page_count) > num_entries)