diff options
author | David Vrabel <david.vrabel@csr.com> | 2010-02-25 08:35:22 -0500 |
---|---|---|
committer | David Vrabel <david.vrabel@csr.com> | 2010-02-25 08:35:22 -0500 |
commit | 03806fa20f6a081493a731a4b18ea66317f9f947 (patch) | |
tree | 630796c65c501e3612253ee4d4af58082a5f984c /drivers/char/agp/amd64-agp.c | |
parent | 35fb2a816a06ded2a3ff83d896c34b83c8e1d556 (diff) | |
parent | baac35c4155a8aa826c70acee6553368ca5243a2 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-upstream
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"); |