Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196555
b: refs/heads/master
c: 6fd0248
h: refs/heads/master
i:
  196553: 9ff0406
  196551: b4dfd0e
v: v3
  • Loading branch information
Ben Hutchings authored and Dave Airlie committed May 19, 2010
1 parent 7a1d165 commit 2b93e68
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d831692a1a8e9ceaaa9bb16bb3fc503b7e372558
refs/heads/master: 6fd024893911dcb51b4a0aa71971db5ba38f7071
27 changes: 15 additions & 12 deletions trunk/drivers/char/agp/amd64-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
u8 cap_ptr;
int err;

/* The Highlander principle */
if (agp_bridges_found)
return -ENODEV;

cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
if (!cap_ptr)
return -ENODEV;
Expand Down Expand Up @@ -563,6 +567,8 @@ static void __devexit agp_amd64_remove(struct pci_dev *pdev)
amd64_aperture_sizes[bridge->aperture_size_idx].size);
agp_remove_bridge(bridge);
agp_put_bridge(bridge);

agp_bridges_found--;
}

#ifdef CONFIG_PM
Expand Down Expand Up @@ -710,6 +716,11 @@ static struct pci_device_id agp_amd64_pci_table[] = {

MODULE_DEVICE_TABLE(pci, agp_amd64_pci_table);

static DEFINE_PCI_DEVICE_TABLE(agp_amd64_pci_promisc_table) = {
{ PCI_DEVICE_CLASS(0, 0) },
{ }
};

static struct pci_driver agp_amd64_pci_driver = {
.name = "agpgart-amd64",
.id_table = agp_amd64_pci_table,
Expand All @@ -735,7 +746,6 @@ int __init agp_amd64_init(void)
return err;

if (agp_bridges_found == 0) {
struct pci_dev *dev;
if (!agp_try_unsupported && !agp_try_unsupported_boot) {
printk(KERN_INFO PFX "No supported AGP bridge found.\n");
#ifdef MODULE
Expand All @@ -751,17 +761,10 @@ int __init agp_amd64_init(void)
return -ENODEV;

/* Look for any AGP bridge */
dev = NULL;
err = -ENODEV;
for_each_pci_dev(dev) {
if (!pci_find_capability(dev, PCI_CAP_ID_AGP))
continue;
/* Only one bridge supported right now */
if (agp_amd64_probe(dev, NULL) == 0) {
err = 0;
break;
}
}
agp_amd64_pci_driver.id_table = agp_amd64_pci_promisc_table;
err = driver_attach(&agp_amd64_pci_driver.driver);
if (err == 0 && agp_bridges_found == 0)
err = -ENODEV;
}
return err;
}
Expand Down

0 comments on commit 2b93e68

Please sign in to comment.