aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/iommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/iommu.c')
-rw-r--r--arch/sparc64/kernel/iommu.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/iommu.c b/arch/sparc64/kernel/iommu.c
index 29af777d7ac9..070a4846c0cb 100644
--- a/arch/sparc64/kernel/iommu.c
+++ b/arch/sparc64/kernel/iommu.c
@@ -472,8 +472,7 @@ static void dma_4u_unmap_single(struct device *dev, dma_addr_t bus_addr,
472 spin_unlock_irqrestore(&iommu->lock, flags); 472 spin_unlock_irqrestore(&iommu->lock, flags);
473} 473}
474 474
475#define SG_ENT_PHYS_ADDRESS(SG) \ 475#define SG_ENT_PHYS_ADDRESS(SG) (__pa(sg_virt((SG))))
476 (__pa(page_address((SG)->page)) + (SG)->offset)
477 476
478static void fill_sg(iopte_t *iopte, struct scatterlist *sg, 477static void fill_sg(iopte_t *iopte, struct scatterlist *sg,
479 int nused, int nelems, 478 int nused, int nelems,
@@ -565,9 +564,7 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
565 /* Fast path single entry scatterlists. */ 564 /* Fast path single entry scatterlists. */
566 if (nelems == 1) { 565 if (nelems == 1) {
567 sglist->dma_address = 566 sglist->dma_address =
568 dma_4u_map_single(dev, 567 dma_4u_map_single(dev, sg_virt(sglist),
569 (page_address(sglist->page) +
570 sglist->offset),
571 sglist->length, direction); 568 sglist->length, direction);
572 if (unlikely(sglist->dma_address == DMA_ERROR_CODE)) 569 if (unlikely(sglist->dma_address == DMA_ERROR_CODE))
573 return 0; 570 return 0;