diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-25 11:01:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-25 11:01:53 -0400 |
commit | 6ae26fa468533c86aaa6936fd366142fcf01386f (patch) | |
tree | e1b5df138d0a3775b6546f2437950eb4fd635d6a /drivers/char/agp | |
parent | 6869ce1c145aaea9f9f8eb8623a261d316b0cd19 (diff) | |
parent | 5bdbc7dc2c07d507b41bffdadc2c8cc13b2d4326 (diff) |
Merge branch 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6
* 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6:
agp: balance ioremap checks
agp: Add device id for P4M900 to via-agp module
efficeon-agp leaks 'struct agp_bridge_data' in error paths of agp_efficeon_probe()
Diffstat (limited to 'drivers/char/agp')
-rw-r--r-- | drivers/char/agp/amd-k7-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/ati-agp.c | 3 | ||||
-rw-r--r-- | drivers/char/agp/efficeon-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/hp-agp.c | 1 | ||||
-rw-r--r-- | drivers/char/agp/i460-agp.c | 4 | ||||
-rw-r--r-- | drivers/char/agp/intel-agp.c | 14 | ||||
-rw-r--r-- | drivers/char/agp/nvidia-agp.c | 3 | ||||
-rw-r--r-- | drivers/char/agp/via-agp.c | 5 |
8 files changed, 29 insertions, 5 deletions
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index df0ddf14b85c..f60bca70d1fb 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c | |||
@@ -223,6 +223,8 @@ static int amd_irongate_configure(void) | |||
223 | pci_read_config_dword(agp_bridge->dev, AMD_MMBASE, &temp); | 223 | pci_read_config_dword(agp_bridge->dev, AMD_MMBASE, &temp); |
224 | temp = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 224 | temp = (temp & PCI_BASE_ADDRESS_MEM_MASK); |
225 | amd_irongate_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); | 225 | amd_irongate_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); |
226 | if (!amd_irongate_private.registers) | ||
227 | return -ENOMEM; | ||
226 | 228 | ||
227 | /* Write out the address of the gatt table */ | 229 | /* Write out the address of the gatt table */ |
228 | writel(agp_bridge->gatt_bus_addr, amd_irongate_private.registers+AMD_ATTBASE); | 230 | writel(agp_bridge->gatt_bus_addr, amd_irongate_private.registers+AMD_ATTBASE); |
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index da7513d7b4e7..2d46b713c8f2 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c | |||
@@ -213,6 +213,9 @@ static int ati_configure(void) | |||
213 | temp = (temp & 0xfffff000); | 213 | temp = (temp & 0xfffff000); |
214 | ati_generic_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); | 214 | ati_generic_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); |
215 | 215 | ||
216 | if (!ati_generic_private.registers) | ||
217 | return -ENOMEM; | ||
218 | |||
216 | if (is_r200()) | 219 | if (is_r200()) |
217 | pci_write_config_dword(agp_bridge->dev, ATI_RS100_IG_AGPMODE, 0x20000); | 220 | pci_write_config_dword(agp_bridge->dev, ATI_RS100_IG_AGPMODE, 0x20000); |
218 | else | 221 | else |
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c index df8da7262853..d78cd09186aa 100644 --- a/drivers/char/agp/efficeon-agp.c +++ b/drivers/char/agp/efficeon-agp.c | |||
@@ -375,6 +375,7 @@ static int __devinit agp_efficeon_probe(struct pci_dev *pdev, | |||
375 | if (!r->start && r->end) { | 375 | if (!r->start && r->end) { |
376 | if (pci_assign_resource(pdev, 0)) { | 376 | if (pci_assign_resource(pdev, 0)) { |
377 | printk(KERN_ERR PFX "could not assign resource 0\n"); | 377 | printk(KERN_ERR PFX "could not assign resource 0\n"); |
378 | agp_put_bridge(bridge); | ||
378 | return -ENODEV; | 379 | return -ENODEV; |
379 | } | 380 | } |
380 | } | 381 | } |
@@ -386,6 +387,7 @@ static int __devinit agp_efficeon_probe(struct pci_dev *pdev, | |||
386 | */ | 387 | */ |
387 | if (pci_enable_device(pdev)) { | 388 | if (pci_enable_device(pdev)) { |
388 | printk(KERN_ERR PFX "Unable to Enable PCI device\n"); | 389 | printk(KERN_ERR PFX "Unable to Enable PCI device\n"); |
390 | agp_put_bridge(bridge); | ||
389 | return -ENODEV; | 391 | return -ENODEV; |
390 | } | 392 | } |
391 | 393 | ||
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c index bcdb149c8179..313a133a1172 100644 --- a/drivers/char/agp/hp-agp.c +++ b/drivers/char/agp/hp-agp.c | |||
@@ -221,6 +221,7 @@ hp_zx1_lba_init (u64 hpa) | |||
221 | if (cap != PCI_CAP_ID_AGP) { | 221 | if (cap != PCI_CAP_ID_AGP) { |
222 | printk(KERN_ERR PFX "Invalid capability ID 0x%02x at 0x%x\n", | 222 | printk(KERN_ERR PFX "Invalid capability ID 0x%02x at 0x%x\n", |
223 | cap, hp->lba_cap_offset); | 223 | cap, hp->lba_cap_offset); |
224 | iounmap(hp->lba_regs); | ||
224 | return -ENODEV; | 225 | return -ENODEV; |
225 | } | 226 | } |
226 | 227 | ||
diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c index 53354bf83af7..75d2aca6353d 100644 --- a/drivers/char/agp/i460-agp.c +++ b/drivers/char/agp/i460-agp.c | |||
@@ -249,6 +249,10 @@ static int i460_create_gatt_table (struct agp_bridge_data *bridge) | |||
249 | num_entries = A_SIZE_8(temp)->num_entries; | 249 | num_entries = A_SIZE_8(temp)->num_entries; |
250 | 250 | ||
251 | i460.gatt = ioremap(INTEL_I460_ATTBASE, PAGE_SIZE << page_order); | 251 | i460.gatt = ioremap(INTEL_I460_ATTBASE, PAGE_SIZE << page_order); |
252 | if (!i460.gatt) { | ||
253 | printk(KERN_ERR PFX "ioremap failed\n"); | ||
254 | return -ENOMEM; | ||
255 | } | ||
252 | 256 | ||
253 | /* These are no good, the should be removed from the agp_bridge strucure... */ | 257 | /* These are no good, the should be removed from the agp_bridge strucure... */ |
254 | agp_bridge->gatt_table_real = NULL; | 258 | agp_bridge->gatt_table_real = NULL; |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 294cdbf4d44d..2c9ca2c64628 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -930,8 +930,10 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge) | |||
930 | temp &= 0xfff80000; | 930 | temp &= 0xfff80000; |
931 | 931 | ||
932 | intel_private.registers = ioremap(temp,128 * 4096); | 932 | intel_private.registers = ioremap(temp,128 * 4096); |
933 | if (!intel_private.registers) | 933 | if (!intel_private.registers) { |
934 | iounmap(intel_private.gtt); | ||
934 | return -ENOMEM; | 935 | return -ENOMEM; |
936 | } | ||
935 | 937 | ||
936 | temp = readl(intel_private.registers+I810_PGETBL_CTL) & 0xfffff000; | 938 | temp = readl(intel_private.registers+I810_PGETBL_CTL) & 0xfffff000; |
937 | global_cache_flush(); /* FIXME: ? */ | 939 | global_cache_flush(); /* FIXME: ? */ |
@@ -985,13 +987,15 @@ static int intel_i965_create_gatt_table(struct agp_bridge_data *bridge) | |||
985 | temp &= 0xfff00000; | 987 | temp &= 0xfff00000; |
986 | intel_private.gtt = ioremap((temp + (512 * 1024)) , 512 * 1024); | 988 | intel_private.gtt = ioremap((temp + (512 * 1024)) , 512 * 1024); |
987 | 989 | ||
988 | if (!intel_private.gtt) | 990 | if (!intel_private.gtt) |
989 | return -ENOMEM; | 991 | return -ENOMEM; |
990 | 992 | ||
991 | 993 | ||
992 | intel_private.registers = ioremap(temp,128 * 4096); | 994 | intel_private.registers = ioremap(temp,128 * 4096); |
993 | if (!intel_private.registers) | 995 | if (!intel_private.registers) { |
994 | return -ENOMEM; | 996 | iounmap(intel_private.gtt); |
997 | return -ENOMEM; | ||
998 | } | ||
995 | 999 | ||
996 | temp = readl(intel_private.registers+I810_PGETBL_CTL) & 0xfffff000; | 1000 | temp = readl(intel_private.registers+I810_PGETBL_CTL) & 0xfffff000; |
997 | global_cache_flush(); /* FIXME: ? */ | 1001 | global_cache_flush(); /* FIXME: ? */ |
diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c index 6cd7373dcdf4..225ed2a53d45 100644 --- a/drivers/char/agp/nvidia-agp.c +++ b/drivers/char/agp/nvidia-agp.c | |||
@@ -157,6 +157,9 @@ static int nvidia_configure(void) | |||
157 | nvidia_private.aperture = | 157 | nvidia_private.aperture = |
158 | (volatile u32 __iomem *) ioremap(apbase, 33 * PAGE_SIZE); | 158 | (volatile u32 __iomem *) ioremap(apbase, 33 * PAGE_SIZE); |
159 | 159 | ||
160 | if (!nvidia_private.aperture) | ||
161 | return -ENOMEM; | ||
162 | |||
160 | return 0; | 163 | return 0; |
161 | } | 164 | } |
162 | 165 | ||
diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c index 9aaf401a8975..0ecc54d327bc 100644 --- a/drivers/char/agp/via-agp.c +++ b/drivers/char/agp/via-agp.c | |||
@@ -399,6 +399,11 @@ static struct agp_device_ids via_agp_device_ids[] __devinitdata = | |||
399 | .device_id = PCI_DEVICE_ID_VIA_P4M890, | 399 | .device_id = PCI_DEVICE_ID_VIA_P4M890, |
400 | .chipset_name = "P4M890", | 400 | .chipset_name = "P4M890", |
401 | }, | 401 | }, |
402 | /* P4M900 */ | ||
403 | { | ||
404 | .device_id = PCI_DEVICE_ID_VIA_VT3364, | ||
405 | .chipset_name = "P4M900", | ||
406 | }, | ||
402 | { }, /* dummy final entry, always present */ | 407 | { }, /* dummy final entry, always present */ |
403 | }; | 408 | }; |
404 | 409 | ||