diff options
author | Joerg Roedel <jroedel@suse.de> | 2014-11-05 09:28:30 -0500 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2014-11-18 05:30:01 -0500 |
commit | 0690cbd2e55a72a8eae557c389d1a136ed9fa142 (patch) | |
tree | 30cefbd6f503d20557e24a1765a027687170a7da | |
parent | d7da6bdc322bb79c4326dff7c2727236a48c4be9 (diff) |
powerpc/iommu: Rename iommu_[un]map_sg functions
The IOMMU-API gained support for a new iommu_map_sg
function. This causes compile failures on powerpc because
the function name is already globally used there.
This patch renames adds a ppc_ prefix to these functions to
solve the compile problem.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r-- | arch/powerpc/include/asm/iommu.h | 17 | ||||
-rw-r--r-- | arch/powerpc/kernel/dma-iommu.c | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/iommu.c | 16 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/iommu.c | 9 |
4 files changed, 27 insertions, 23 deletions
diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h index 42632c7a2a4e..9cfa3706a1b8 100644 --- a/arch/powerpc/include/asm/iommu.h +++ b/arch/powerpc/include/asm/iommu.h | |||
@@ -137,13 +137,16 @@ static inline void set_iommu_table_base_and_group(struct device *dev, | |||
137 | iommu_add_device(dev); | 137 | iommu_add_device(dev); |
138 | } | 138 | } |
139 | 139 | ||
140 | extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl, | 140 | extern int ppc_iommu_map_sg(struct device *dev, struct iommu_table *tbl, |
141 | struct scatterlist *sglist, int nelems, | 141 | struct scatterlist *sglist, int nelems, |
142 | unsigned long mask, enum dma_data_direction direction, | 142 | unsigned long mask, |
143 | struct dma_attrs *attrs); | 143 | enum dma_data_direction direction, |
144 | extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, | 144 | struct dma_attrs *attrs); |
145 | int nelems, enum dma_data_direction direction, | 145 | extern void ppc_iommu_unmap_sg(struct iommu_table *tbl, |
146 | struct dma_attrs *attrs); | 146 | struct scatterlist *sglist, |
147 | int nelems, | ||
148 | enum dma_data_direction direction, | ||
149 | struct dma_attrs *attrs); | ||
147 | 150 | ||
148 | extern void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl, | 151 | extern void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl, |
149 | size_t size, dma_addr_t *dma_handle, | 152 | size_t size, dma_addr_t *dma_handle, |
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index 54d0116256f7..4c68bfe4108a 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-iommu.c | |||
@@ -60,16 +60,16 @@ static int dma_iommu_map_sg(struct device *dev, struct scatterlist *sglist, | |||
60 | int nelems, enum dma_data_direction direction, | 60 | int nelems, enum dma_data_direction direction, |
61 | struct dma_attrs *attrs) | 61 | struct dma_attrs *attrs) |
62 | { | 62 | { |
63 | return iommu_map_sg(dev, get_iommu_table_base(dev), sglist, nelems, | 63 | return ppc_iommu_map_sg(dev, get_iommu_table_base(dev), sglist, nelems, |
64 | device_to_mask(dev), direction, attrs); | 64 | device_to_mask(dev), direction, attrs); |
65 | } | 65 | } |
66 | 66 | ||
67 | static void dma_iommu_unmap_sg(struct device *dev, struct scatterlist *sglist, | 67 | static void dma_iommu_unmap_sg(struct device *dev, struct scatterlist *sglist, |
68 | int nelems, enum dma_data_direction direction, | 68 | int nelems, enum dma_data_direction direction, |
69 | struct dma_attrs *attrs) | 69 | struct dma_attrs *attrs) |
70 | { | 70 | { |
71 | iommu_unmap_sg(get_iommu_table_base(dev), sglist, nelems, direction, | 71 | ppc_iommu_unmap_sg(get_iommu_table_base(dev), sglist, nelems, |
72 | attrs); | 72 | direction, attrs); |
73 | } | 73 | } |
74 | 74 | ||
75 | /* We support DMA to/from any memory page via the iommu */ | 75 | /* We support DMA to/from any memory page via the iommu */ |
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index a10642a0d861..a83cf5ef6488 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c | |||
@@ -428,10 +428,10 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, | |||
428 | ppc_md.tce_flush(tbl); | 428 | ppc_md.tce_flush(tbl); |
429 | } | 429 | } |
430 | 430 | ||
431 | int iommu_map_sg(struct device *dev, struct iommu_table *tbl, | 431 | int ppc_iommu_map_sg(struct device *dev, struct iommu_table *tbl, |
432 | struct scatterlist *sglist, int nelems, | 432 | struct scatterlist *sglist, int nelems, |
433 | unsigned long mask, enum dma_data_direction direction, | 433 | unsigned long mask, enum dma_data_direction direction, |
434 | struct dma_attrs *attrs) | 434 | struct dma_attrs *attrs) |
435 | { | 435 | { |
436 | dma_addr_t dma_next = 0, dma_addr; | 436 | dma_addr_t dma_next = 0, dma_addr; |
437 | struct scatterlist *s, *outs, *segstart; | 437 | struct scatterlist *s, *outs, *segstart; |
@@ -539,7 +539,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl, | |||
539 | 539 | ||
540 | DBG("mapped %d elements:\n", outcount); | 540 | DBG("mapped %d elements:\n", outcount); |
541 | 541 | ||
542 | /* For the sake of iommu_unmap_sg, we clear out the length in the | 542 | /* For the sake of ppc_iommu_unmap_sg, we clear out the length in the |
543 | * next entry of the sglist if we didn't fill the list completely | 543 | * next entry of the sglist if we didn't fill the list completely |
544 | */ | 544 | */ |
545 | if (outcount < incount) { | 545 | if (outcount < incount) { |
@@ -572,9 +572,9 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl, | |||
572 | } | 572 | } |
573 | 573 | ||
574 | 574 | ||
575 | void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, | 575 | void ppc_iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, |
576 | int nelems, enum dma_data_direction direction, | 576 | int nelems, enum dma_data_direction direction, |
577 | struct dma_attrs *attrs) | 577 | struct dma_attrs *attrs) |
578 | { | 578 | { |
579 | struct scatterlist *sg; | 579 | struct scatterlist *sg; |
580 | 580 | ||
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index 2b90ff8a93be..c7c8720aa39f 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -621,8 +621,9 @@ static int dma_fixed_map_sg(struct device *dev, struct scatterlist *sg, | |||
621 | if (iommu_fixed_is_weak == dma_get_attr(DMA_ATTR_WEAK_ORDERING, attrs)) | 621 | if (iommu_fixed_is_weak == dma_get_attr(DMA_ATTR_WEAK_ORDERING, attrs)) |
622 | return dma_direct_ops.map_sg(dev, sg, nents, direction, attrs); | 622 | return dma_direct_ops.map_sg(dev, sg, nents, direction, attrs); |
623 | else | 623 | else |
624 | return iommu_map_sg(dev, cell_get_iommu_table(dev), sg, nents, | 624 | return ppc_iommu_map_sg(dev, cell_get_iommu_table(dev), sg, |
625 | device_to_mask(dev), direction, attrs); | 625 | nents, device_to_mask(dev), |
626 | direction, attrs); | ||
626 | } | 627 | } |
627 | 628 | ||
628 | static void dma_fixed_unmap_sg(struct device *dev, struct scatterlist *sg, | 629 | static void dma_fixed_unmap_sg(struct device *dev, struct scatterlist *sg, |
@@ -632,8 +633,8 @@ static void dma_fixed_unmap_sg(struct device *dev, struct scatterlist *sg, | |||
632 | if (iommu_fixed_is_weak == dma_get_attr(DMA_ATTR_WEAK_ORDERING, attrs)) | 633 | if (iommu_fixed_is_weak == dma_get_attr(DMA_ATTR_WEAK_ORDERING, attrs)) |
633 | dma_direct_ops.unmap_sg(dev, sg, nents, direction, attrs); | 634 | dma_direct_ops.unmap_sg(dev, sg, nents, direction, attrs); |
634 | else | 635 | else |
635 | iommu_unmap_sg(cell_get_iommu_table(dev), sg, nents, direction, | 636 | ppc_iommu_unmap_sg(cell_get_iommu_table(dev), sg, nents, |
636 | attrs); | 637 | direction, attrs); |
637 | } | 638 | } |
638 | 639 | ||
639 | static int dma_fixed_dma_supported(struct device *dev, u64 mask) | 640 | static int dma_fixed_dma_supported(struct device *dev, u64 mask) |