diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2011-12-06 08:14:46 -0500 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-03-28 10:36:33 -0400 |
commit | bfbf7d615101391c4e24792685b64b38d84d542e (patch) | |
tree | 26baa8dac26ae2d159d82348cf2f05098ecf9b35 /arch/powerpc/platforms/cell | |
parent | e8d51e54ab4020d984dda471ca077c7fed094326 (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/platforms/cell')
-rw-r--r-- | arch/powerpc/platforms/cell/iommu.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index ae9fc7bc17d6..b9f509a34c01 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -564,7 +564,8 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev) | |||
564 | /* A coherent allocation implies strong ordering */ | 564 | /* A coherent allocation implies strong ordering */ |
565 | 565 | ||
566 | static void *dma_fixed_alloc_coherent(struct device *dev, size_t size, | 566 | static void *dma_fixed_alloc_coherent(struct device *dev, size_t size, |
567 | dma_addr_t *dma_handle, gfp_t flag) | 567 | dma_addr_t *dma_handle, gfp_t flag, |
568 | struct dma_attrs *attrs) | ||
568 | { | 569 | { |
569 | if (iommu_fixed_is_weak) | 570 | if (iommu_fixed_is_weak) |
570 | return iommu_alloc_coherent(dev, cell_get_iommu_table(dev), | 571 | return iommu_alloc_coherent(dev, cell_get_iommu_table(dev), |
@@ -572,18 +573,19 @@ static void *dma_fixed_alloc_coherent(struct device *dev, size_t size, | |||
572 | device_to_mask(dev), flag, | 573 | device_to_mask(dev), flag, |
573 | dev_to_node(dev)); | 574 | dev_to_node(dev)); |
574 | else | 575 | else |
575 | return dma_direct_ops.alloc_coherent(dev, size, dma_handle, | 576 | return dma_direct_ops.alloc(dev, size, dma_handle, flag, |
576 | flag); | 577 | attrs); |
577 | } | 578 | } |
578 | 579 | ||
579 | static void dma_fixed_free_coherent(struct device *dev, size_t size, | 580 | static void dma_fixed_free_coherent(struct device *dev, size_t size, |
580 | void *vaddr, dma_addr_t dma_handle) | 581 | void *vaddr, dma_addr_t dma_handle, |
582 | struct dma_attrs *attrs) | ||
581 | { | 583 | { |
582 | if (iommu_fixed_is_weak) | 584 | if (iommu_fixed_is_weak) |
583 | iommu_free_coherent(cell_get_iommu_table(dev), size, vaddr, | 585 | iommu_free_coherent(cell_get_iommu_table(dev), size, vaddr, |
584 | dma_handle); | 586 | dma_handle); |
585 | else | 587 | else |
586 | dma_direct_ops.free_coherent(dev, size, vaddr, dma_handle); | 588 | dma_direct_ops.free(dev, size, vaddr, dma_handle, attrs); |
587 | } | 589 | } |
588 | 590 | ||
589 | static dma_addr_t dma_fixed_map_page(struct device *dev, struct page *page, | 591 | static dma_addr_t dma_fixed_map_page(struct device *dev, struct page *page, |
@@ -642,8 +644,8 @@ static int dma_fixed_dma_supported(struct device *dev, u64 mask) | |||
642 | static int dma_set_mask_and_switch(struct device *dev, u64 dma_mask); | 644 | static int dma_set_mask_and_switch(struct device *dev, u64 dma_mask); |
643 | 645 | ||
644 | struct dma_map_ops dma_iommu_fixed_ops = { | 646 | struct dma_map_ops dma_iommu_fixed_ops = { |
645 | .alloc_coherent = dma_fixed_alloc_coherent, | 647 | .alloc = dma_fixed_alloc_coherent, |
646 | .free_coherent = dma_fixed_free_coherent, | 648 | .free = dma_fixed_free_coherent, |
647 | .map_sg = dma_fixed_map_sg, | 649 | .map_sg = dma_fixed_map_sg, |
648 | .unmap_sg = dma_fixed_unmap_sg, | 650 | .unmap_sg = dma_fixed_unmap_sg, |
649 | .dma_supported = dma_fixed_dma_supported, | 651 | .dma_supported = dma_fixed_dma_supported, |