From: Glauber Costa Date: Tue, 8 Apr 2008 16:20:51 +0000 (-0300) Subject: x86: move initialization functions to pci-dma.c X-Git-Tag: Ubuntu-5.0.0-8.9~34908^2~19 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=cb5867a5d8ca20e16ddc3397c36ee9c2e4cba219;p=mirror_ubuntu-disco-kernel.git x86: move initialization functions to pci-dma.c initcalls that triggers the various possibiities for dma subsys are moved to pci-dma.c. Signed-off-by: Glauber Costa Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 37a558a96153..6b77fd872a7a 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c @@ -1,4 +1,8 @@ #include +#include + +#include +#include const struct dma_mapping_ops *dma_ops; EXPORT_SYMBOL(dma_ops); @@ -22,4 +26,25 @@ int dma_set_mask(struct device *dev, u64 mask) } EXPORT_SYMBOL(dma_set_mask); +static int __init pci_iommu_init(void) +{ +#ifdef CONFIG_CALGARY_IOMMU + calgary_iommu_init(); +#endif + + intel_iommu_init(); + +#ifdef CONFIG_GART_IOMMU + gart_iommu_init(); +#endif + no_iommu_init(); + return 0; +} + +void pci_iommu_shutdown(void) +{ + gart_iommu_shutdown(); +} +/* Must execute after PCI subsystem */ +fs_initcall(pci_iommu_init); diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma_64.c index 9ef18bfad2ad..42021300964a 100644 --- a/arch/x86/kernel/pci-dma_64.c +++ b/arch/x86/kernel/pci-dma_64.c @@ -339,27 +339,6 @@ void __init pci_iommu_alloc(void) #endif } -static int __init pci_iommu_init(void) -{ -#ifdef CONFIG_CALGARY_IOMMU - calgary_iommu_init(); -#endif - - intel_iommu_init(); - -#ifdef CONFIG_GART_IOMMU - gart_iommu_init(); -#endif - - no_iommu_init(); - return 0; -} - -void pci_iommu_shutdown(void) -{ - gart_iommu_shutdown(); -} - #ifdef CONFIG_PCI /* Many VIA bridges seem to corrupt data for DAC. Disable it here */ @@ -372,5 +351,3 @@ static __devinit void via_no_dac(struct pci_dev *dev) } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac); #endif -/* Must execute after PCI subsystem */ -fs_initcall(pci_iommu_init);