aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/amd64-agp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp/amd64-agp.c')
-rw-r--r--drivers/char/agp/amd64-agp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index 2fb2e6cc322a..5aa7a586a7ff 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -725,9 +725,14 @@ static struct pci_driver agp_amd64_pci_driver = {
725int __init agp_amd64_init(void) 725int __init agp_amd64_init(void)
726{ 726{
727 int err = 0; 727 int err = 0;
728 static int done = 0;
728 729
729 if (agp_off) 730 if (agp_off)
730 return -EINVAL; 731 return -EINVAL;
732
733 if (done++)
734 return agp_bridges_found ? 0 : -ENODEV;
735
731 err = pci_register_driver(&agp_amd64_pci_driver); 736 err = pci_register_driver(&agp_amd64_pci_driver);
732 if (err < 0) 737 if (err < 0)
733 return err; 738 return err;
@@ -771,12 +776,8 @@ static void __exit agp_amd64_cleanup(void)
771 pci_unregister_driver(&agp_amd64_pci_driver); 776 pci_unregister_driver(&agp_amd64_pci_driver);
772} 777}
773 778
774/* On AMD64 the PCI driver needs to initialize this driver early
775 for the IOMMU, so it has to be called via a backdoor. */
776#ifndef CONFIG_GART_IOMMU
777module_init(agp_amd64_init); 779module_init(agp_amd64_init);
778module_exit(agp_amd64_cleanup); 780module_exit(agp_amd64_cleanup);
779#endif
780 781
781MODULE_AUTHOR("Dave Jones <davej@redhat.com>, Andi Kleen"); 782MODULE_AUTHOR("Dave Jones <davej@redhat.com>, Andi Kleen");
782module_param(agp_try_unsupported, bool, 0); 783module_param(agp_try_unsupported, bool, 0);