aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMark Nelson <markn@au1.ibm.com>2008-07-04 15:05:44 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-09 02:30:43 -0400
commit7e5f8105030038de94b44a74cd7b64dd000830fc (patch)
treef06d44bb94b9d1dfd4b32fe99fa8c918a4284ad2 /arch
parent3affedc4e1ce837033b6c5e9289d2ce2f5a62d31 (diff)
powerpc/cell: cell_dma_dev_setup_iommu() return the iommu table
Make cell_dma_dev_setup_iommu() return a pointer to the struct iommu_table (or NULL if no table can be found) rather than putting this pointer into dev->archdata.dma_data (let the caller do that), and rename this function to cell_get_iommu_table() to reflect this change. This will allow us to get the iommu table for a device that doesn't have the table in the archdata. Signed-off-by: Mark Nelson <markn@au1.ibm.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/cell/iommu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 45646b2b4af4..eeacb3a52ca1 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -540,7 +540,7 @@ static unsigned long cell_dma_direct_offset;
540static unsigned long dma_iommu_fixed_base; 540static unsigned long dma_iommu_fixed_base;
541struct dma_mapping_ops dma_iommu_fixed_ops; 541struct dma_mapping_ops dma_iommu_fixed_ops;
542 542
543static void cell_dma_dev_setup_iommu(struct device *dev) 543static struct iommu_table *cell_get_iommu_table(struct device *dev)
544{ 544{
545 struct iommu_window *window; 545 struct iommu_window *window;
546 struct cbe_iommu *iommu; 546 struct cbe_iommu *iommu;
@@ -555,11 +555,11 @@ static void cell_dma_dev_setup_iommu(struct device *dev)
555 printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n", 555 printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n",
556 archdata->of_node ? archdata->of_node->full_name : "?", 556 archdata->of_node ? archdata->of_node->full_name : "?",
557 archdata->numa_node); 557 archdata->numa_node);
558 return; 558 return NULL;
559 } 559 }
560 window = list_entry(iommu->windows.next, struct iommu_window, list); 560 window = list_entry(iommu->windows.next, struct iommu_window, list);
561 561
562 archdata->dma_data = &window->table; 562 return &window->table;
563} 563}
564 564
565static void cell_dma_dev_setup_fixed(struct device *dev); 565static void cell_dma_dev_setup_fixed(struct device *dev);
@@ -572,7 +572,7 @@ static void cell_dma_dev_setup(struct device *dev)
572 if (get_dma_ops(dev) == &dma_iommu_fixed_ops) 572 if (get_dma_ops(dev) == &dma_iommu_fixed_ops)
573 cell_dma_dev_setup_fixed(dev); 573 cell_dma_dev_setup_fixed(dev);
574 else if (get_pci_dma_ops() == &dma_iommu_ops) 574 else if (get_pci_dma_ops() == &dma_iommu_ops)
575 cell_dma_dev_setup_iommu(dev); 575 archdata->dma_data = cell_get_iommu_table(dev);
576 else if (get_pci_dma_ops() == &dma_direct_ops) 576 else if (get_pci_dma_ops() == &dma_direct_ops)
577 archdata->dma_data = (void *)cell_dma_direct_offset; 577 archdata->dma_data = (void *)cell_dma_direct_offset;
578 else 578 else