aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/android/ion/ion_system_heap.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-09-18 12:30:20 -0500
committerColin Cross <ccross@android.com>2013-11-15 16:10:14 -0800
commit51e3580bf9da57da9c860330293b73b0dbb296e0 (patch)
tree3c8a11e23d9cdb26f9ebdf9cc6492695c0f5ea51 /drivers/staging/android/ion/ion_system_heap.c
parent49bdc418a3c1129d49fe92d89cf77111584fb51f (diff)
ion: fix dma APIs
__dma_page_cpu_to_dev is a private ARM api that is not available on 3.10 and was never available on other architectures. We can get the same behavior by calling dma_sync_sg_for_device with a scatterlist containing a single page. It's still not quite a kosher use of the dma apis, we still conflate physical addresses with bus addresses, but it should at least compile on all platforms, and work on any platform that doesn't have a physical to bus address translation. Change-Id: I8451c2dae4bf85841015c016640684ac28430a5a Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'drivers/staging/android/ion/ion_system_heap.c')
-rw-r--r--drivers/staging/android/ion/ion_system_heap.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index 06e0702396a..90b2e04157c 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -77,9 +77,8 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap,
page = ion_heap_alloc_pages(buffer, gfp_flags, order);
if (!page)
return 0;
- arm_dma_ops.sync_single_for_device(NULL,
- pfn_to_dma(NULL, page_to_pfn(page)),
- PAGE_SIZE << order, DMA_BIDIRECTIONAL);
+ ion_pages_sync_for_device(NULL, page, PAGE_SIZE << order,
+ DMA_BIDIRECTIONAL);
}
if (!page)
return 0;