aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/vio.c
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2011-12-06 08:14:46 -0500
committerMarek Szyprowski <m.szyprowski@samsung.com>2012-03-28 10:36:33 -0400
commitbfbf7d615101391c4e24792685b64b38d84d542e (patch)
tree26baa8dac26ae2d159d82348cf2f05098ecf9b35 /arch/powerpc/kernel/vio.c
parente8d51e54ab4020d984dda471ca077c7fed094326 (diff)
PowerPC: adapt for dma_map_ops changes
Adapt core PowerPC architecture code for dma_map_ops changes: replace alloc/free_coherent with generic alloc/free methods. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> [added missing changes to arch/powerpc/kernel/vio.c] Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/powerpc/kernel/vio.c')
-rw-r--r--arch/powerpc/kernel/vio.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 8b086299ba25..2d49c32b9dd3 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -487,7 +487,8 @@ static void vio_cmo_balance(struct work_struct *work)
487} 487}
488 488
489static void *vio_dma_iommu_alloc_coherent(struct device *dev, size_t size, 489static void *vio_dma_iommu_alloc_coherent(struct device *dev, size_t size,
490 dma_addr_t *dma_handle, gfp_t flag) 490 dma_addr_t *dma_handle, gfp_t flag,
491 struct dma_attrs *attrs)
491{ 492{
492 struct vio_dev *viodev = to_vio_dev(dev); 493 struct vio_dev *viodev = to_vio_dev(dev);
493 void *ret; 494 void *ret;
@@ -497,7 +498,7 @@ static void *vio_dma_iommu_alloc_coherent(struct device *dev, size_t size,
497 return NULL; 498 return NULL;
498 } 499 }
499 500
500 ret = dma_iommu_ops.alloc_coherent(dev, size, dma_handle, flag); 501 ret = dma_iommu_ops.alloc(dev, size, dma_handle, flag, attrs);
501 if (unlikely(ret == NULL)) { 502 if (unlikely(ret == NULL)) {
502 vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE)); 503 vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE));
503 atomic_inc(&viodev->cmo.allocs_failed); 504 atomic_inc(&viodev->cmo.allocs_failed);
@@ -507,11 +508,12 @@ static void *vio_dma_iommu_alloc_coherent(struct device *dev, size_t size,
507} 508}
508 509
509static void vio_dma_iommu_free_coherent(struct device *dev, size_t size, 510static void vio_dma_iommu_free_coherent(struct device *dev, size_t size,
510 void *vaddr, dma_addr_t dma_handle) 511 void *vaddr, dma_addr_t dma_handle,
512 struct dma_attrs *attrs)
511{ 513{
512 struct vio_dev *viodev = to_vio_dev(dev); 514 struct vio_dev *viodev = to_vio_dev(dev);
513 515
514 dma_iommu_ops.free_coherent(dev, size, vaddr, dma_handle); 516 dma_iommu_ops.free(dev, size, vaddr, dma_handle, attrs);
515 517
516 vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE)); 518 vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE));
517} 519}
@@ -612,8 +614,8 @@ static u64 vio_dma_get_required_mask(struct device *dev)
612} 614}
613 615
614struct dma_map_ops vio_dma_mapping_ops = { 616struct dma_map_ops vio_dma_mapping_ops = {
615 .alloc_coherent = vio_dma_iommu_alloc_coherent, 617 .alloc = vio_dma_iommu_alloc_coherent,
616 .free_coherent = vio_dma_iommu_free_coherent, 618 .free = vio_dma_iommu_free_coherent,
617 .map_sg = vio_dma_iommu_map_sg, 619 .map_sg = vio_dma_iommu_map_sg,
618 .unmap_sg = vio_dma_iommu_unmap_sg, 620 .unmap_sg = vio_dma_iommu_unmap_sg,
619 .map_page = vio_dma_iommu_map_page, 621 .map_page = vio_dma_iommu_map_page,