diff options
Diffstat (limited to 'arch/powerpc/kernel/vio.c')
-rw-r--r-- | arch/powerpc/kernel/vio.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index 434c92a85c03..a11e6bc59b30 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -516,10 +516,10 @@ static void vio_dma_iommu_free_coherent(struct device *dev, size_t size, | |||
516 | vio_cmo_dealloc(viodev, roundup(size, IOMMU_PAGE_SIZE)); | 516 | vio_cmo_dealloc(viodev, roundup(size, IOMMU_PAGE_SIZE)); |
517 | } | 517 | } |
518 | 518 | ||
519 | static dma_addr_t vio_dma_iommu_map_single(struct device *dev, void *vaddr, | 519 | static dma_addr_t vio_dma_iommu_map_page(struct device *dev, struct page *page, |
520 | size_t size, | 520 | unsigned long offset, size_t size, |
521 | enum dma_data_direction direction, | 521 | enum dma_data_direction direction, |
522 | struct dma_attrs *attrs) | 522 | struct dma_attrs *attrs) |
523 | { | 523 | { |
524 | struct vio_dev *viodev = to_vio_dev(dev); | 524 | struct vio_dev *viodev = to_vio_dev(dev); |
525 | dma_addr_t ret = DMA_ERROR_CODE; | 525 | dma_addr_t ret = DMA_ERROR_CODE; |
@@ -529,7 +529,7 @@ static dma_addr_t vio_dma_iommu_map_single(struct device *dev, void *vaddr, | |||
529 | return ret; | 529 | return ret; |
530 | } | 530 | } |
531 | 531 | ||
532 | ret = dma_iommu_ops.map_single(dev, vaddr, size, direction, attrs); | 532 | ret = dma_iommu_ops.map_page(dev, page, offset, size, direction, attrs); |
533 | if (unlikely(dma_mapping_error(dev, ret))) { | 533 | if (unlikely(dma_mapping_error(dev, ret))) { |
534 | vio_cmo_dealloc(viodev, roundup(size, IOMMU_PAGE_SIZE)); | 534 | vio_cmo_dealloc(viodev, roundup(size, IOMMU_PAGE_SIZE)); |
535 | atomic_inc(&viodev->cmo.allocs_failed); | 535 | atomic_inc(&viodev->cmo.allocs_failed); |
@@ -538,14 +538,14 @@ static dma_addr_t vio_dma_iommu_map_single(struct device *dev, void *vaddr, | |||
538 | return ret; | 538 | return ret; |
539 | } | 539 | } |
540 | 540 | ||
541 | static void vio_dma_iommu_unmap_single(struct device *dev, | 541 | static void vio_dma_iommu_unmap_page(struct device *dev, dma_addr_t dma_handle, |
542 | dma_addr_t dma_handle, size_t size, | 542 | size_t size, |
543 | enum dma_data_direction direction, | 543 | enum dma_data_direction direction, |
544 | struct dma_attrs *attrs) | 544 | struct dma_attrs *attrs) |
545 | { | 545 | { |
546 | struct vio_dev *viodev = to_vio_dev(dev); | 546 | struct vio_dev *viodev = to_vio_dev(dev); |
547 | 547 | ||
548 | dma_iommu_ops.unmap_single(dev, dma_handle, size, direction, attrs); | 548 | dma_iommu_ops.unmap_page(dev, dma_handle, size, direction, attrs); |
549 | 549 | ||
550 | vio_cmo_dealloc(viodev, roundup(size, IOMMU_PAGE_SIZE)); | 550 | vio_cmo_dealloc(viodev, roundup(size, IOMMU_PAGE_SIZE)); |
551 | } | 551 | } |
@@ -603,10 +603,11 @@ static void vio_dma_iommu_unmap_sg(struct device *dev, | |||
603 | struct dma_mapping_ops vio_dma_mapping_ops = { | 603 | struct dma_mapping_ops vio_dma_mapping_ops = { |
604 | .alloc_coherent = vio_dma_iommu_alloc_coherent, | 604 | .alloc_coherent = vio_dma_iommu_alloc_coherent, |
605 | .free_coherent = vio_dma_iommu_free_coherent, | 605 | .free_coherent = vio_dma_iommu_free_coherent, |
606 | .map_single = vio_dma_iommu_map_single, | ||
607 | .unmap_single = vio_dma_iommu_unmap_single, | ||
608 | .map_sg = vio_dma_iommu_map_sg, | 606 | .map_sg = vio_dma_iommu_map_sg, |
609 | .unmap_sg = vio_dma_iommu_unmap_sg, | 607 | .unmap_sg = vio_dma_iommu_unmap_sg, |
608 | .map_page = vio_dma_iommu_map_page, | ||
609 | .unmap_page = vio_dma_iommu_unmap_page, | ||
610 | |||
610 | }; | 611 | }; |
611 | 612 | ||
612 | /** | 613 | /** |