diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-02-26 03:18:32 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-26 03:18:32 -0500 |
commit | 64b9fb5704a479d98a59f2a1d45d3331a8f847f8 (patch) | |
tree | 2b1052b05fa7615c817894bc9802bc5bb2af7ac1 /drivers/char/agp/amd64-agp.c | |
parent | 83f0d53993b2967e54186468b0fc4321447f68f1 (diff) | |
parent | 60b341b778cc2929df16c0a504c91621b3c6a4ad (diff) |
Merge commit 'v2.6.33' into tracing/core
Conflicts:
scripts/recordmcount.pl
Merge reason: Merge up to v2.6.33.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/char/agp/amd64-agp.c')
-rw-r--r-- | drivers/char/agp/amd64-agp.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 5aa7a586a7ff..fd50ead59c79 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -725,14 +725,10 @@ static struct pci_driver agp_amd64_pci_driver = { | |||
725 | int __init agp_amd64_init(void) | 725 | int __init agp_amd64_init(void) |
726 | { | 726 | { |
727 | int err = 0; | 727 | int err = 0; |
728 | static int done = 0; | ||
729 | 728 | ||
730 | if (agp_off) | 729 | if (agp_off) |
731 | return -EINVAL; | 730 | return -EINVAL; |
732 | 731 | ||
733 | if (done++) | ||
734 | return agp_bridges_found ? 0 : -ENODEV; | ||
735 | |||
736 | err = pci_register_driver(&agp_amd64_pci_driver); | 732 | err = pci_register_driver(&agp_amd64_pci_driver); |
737 | if (err < 0) | 733 | if (err < 0) |
738 | return err; | 734 | return err; |
@@ -769,14 +765,27 @@ int __init agp_amd64_init(void) | |||
769 | return err; | 765 | return err; |
770 | } | 766 | } |
771 | 767 | ||
768 | static int __init agp_amd64_mod_init(void) | ||
769 | { | ||
770 | #ifndef MODULE | ||
771 | if (gart_iommu_aperture) | ||
772 | return agp_bridges_found ? 0 : -ENODEV; | ||
773 | #endif | ||
774 | return agp_amd64_init(); | ||
775 | } | ||
776 | |||
772 | static void __exit agp_amd64_cleanup(void) | 777 | static void __exit agp_amd64_cleanup(void) |
773 | { | 778 | { |
779 | #ifndef MODULE | ||
780 | if (gart_iommu_aperture) | ||
781 | return; | ||
782 | #endif | ||
774 | if (aperture_resource) | 783 | if (aperture_resource) |
775 | release_resource(aperture_resource); | 784 | release_resource(aperture_resource); |
776 | pci_unregister_driver(&agp_amd64_pci_driver); | 785 | pci_unregister_driver(&agp_amd64_pci_driver); |
777 | } | 786 | } |
778 | 787 | ||
779 | module_init(agp_amd64_init); | 788 | module_init(agp_amd64_mod_init); |
780 | module_exit(agp_amd64_cleanup); | 789 | module_exit(agp_amd64_cleanup); |
781 | 790 | ||
782 | MODULE_AUTHOR("Dave Jones <davej@redhat.com>, Andi Kleen"); | 791 | MODULE_AUTHOR("Dave Jones <davej@redhat.com>, Andi Kleen"); |