]> err.no Git - linux-2.6/blobdiff - arch/powerpc/kernel/pci_iommu.c
[PATCH] Add comments to the PDA structure to annotate offsets
[linux-2.6] / arch / powerpc / kernel / pci_iommu.c
index 48aa82d01624f7f20e63e3c0203f05cc44f05d76..0688b2534acbe74019e258aca7ec21336051fcb8 100644 (file)
@@ -86,7 +86,8 @@ static void *pci_iommu_alloc_coherent(struct device *hwdev, size_t size,
                           dma_addr_t *dma_handle, gfp_t flag)
 {
        return iommu_alloc_coherent(device_to_table(hwdev), size, dma_handle,
-                       device_to_mask(hwdev), flag);
+                       device_to_mask(hwdev), flag,
+                       pcibus_to_node(to_pci_dev(hwdev)->bus));
 }
 
 static void pci_iommu_free_coherent(struct device *hwdev, size_t size,
@@ -147,13 +148,17 @@ static int pci_iommu_dma_supported(struct device *dev, u64 mask)
                return 1;
 }
 
+struct dma_mapping_ops pci_iommu_ops = {
+       .alloc_coherent = pci_iommu_alloc_coherent,
+       .free_coherent = pci_iommu_free_coherent,
+       .map_single = pci_iommu_map_single,
+       .unmap_single = pci_iommu_unmap_single,
+       .map_sg = pci_iommu_map_sg,
+       .unmap_sg = pci_iommu_unmap_sg,
+       .dma_supported = pci_iommu_dma_supported,
+};
+
 void pci_iommu_init(void)
 {
-       pci_dma_ops.alloc_coherent = pci_iommu_alloc_coherent;
-       pci_dma_ops.free_coherent = pci_iommu_free_coherent;
-       pci_dma_ops.map_single = pci_iommu_map_single;
-       pci_dma_ops.unmap_single = pci_iommu_unmap_single;
-       pci_dma_ops.map_sg = pci_iommu_map_sg;
-       pci_dma_ops.unmap_sg = pci_iommu_unmap_sg;
-       pci_dma_ops.dma_supported = pci_iommu_dma_supported;
+       pci_dma_ops = pci_iommu_ops;
 }