diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/agp/amd64-agp.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 481ffe87c716..7345f9a9b791 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -34,6 +34,7 @@ | |||
34 | 34 | ||
35 | static struct resource *aperture_resource; | 35 | static struct resource *aperture_resource; |
36 | static int __initdata agp_try_unsupported = 1; | 36 | static int __initdata agp_try_unsupported = 1; |
37 | static int agp_bridges_found; | ||
37 | 38 | ||
38 | static void amd64_tlbflush(struct agp_memory *temp) | 39 | static void amd64_tlbflush(struct agp_memory *temp) |
39 | { | 40 | { |
@@ -489,6 +490,7 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev, | |||
489 | { | 490 | { |
490 | struct agp_bridge_data *bridge; | 491 | struct agp_bridge_data *bridge; |
491 | u8 cap_ptr; | 492 | u8 cap_ptr; |
493 | int err; | ||
492 | 494 | ||
493 | cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP); | 495 | cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP); |
494 | if (!cap_ptr) | 496 | if (!cap_ptr) |
@@ -536,7 +538,12 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev, | |||
536 | } | 538 | } |
537 | 539 | ||
538 | pci_set_drvdata(pdev, bridge); | 540 | pci_set_drvdata(pdev, bridge); |
539 | return agp_add_bridge(bridge); | 541 | err = agp_add_bridge(bridge); |
542 | if (err < 0) | ||
543 | return err; | ||
544 | |||
545 | agp_bridges_found++; | ||
546 | return 0; | ||
540 | } | 547 | } |
541 | 548 | ||
542 | static void __devexit agp_amd64_remove(struct pci_dev *pdev) | 549 | static void __devexit agp_amd64_remove(struct pci_dev *pdev) |
@@ -713,7 +720,11 @@ int __init agp_amd64_init(void) | |||
713 | 720 | ||
714 | if (agp_off) | 721 | if (agp_off) |
715 | return -EINVAL; | 722 | return -EINVAL; |
716 | if (pci_register_driver(&agp_amd64_pci_driver) < 0) { | 723 | err = pci_register_driver(&agp_amd64_pci_driver); |
724 | if (err < 0) | ||
725 | return err; | ||
726 | |||
727 | if (agp_bridges_found == 0) { | ||
717 | struct pci_dev *dev; | 728 | struct pci_dev *dev; |
718 | if (!agp_try_unsupported && !agp_try_unsupported_boot) { | 729 | if (!agp_try_unsupported && !agp_try_unsupported_boot) { |
719 | printk(KERN_INFO PFX "No supported AGP bridge found.\n"); | 730 | printk(KERN_INFO PFX "No supported AGP bridge found.\n"); |