summaryrefslogtreecommitdiff
path: root/drivers/staging/android/ion/ion_page_pool.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-12-13 22:25:01 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-14 16:57:18 (GMT)
commite946b209c2ed15b1f7917def8fe6602747c3f771 (patch)
tree8860214869fc38f01dbd05f821487596aafccbc4 /drivers/staging/android/ion/ion_page_pool.c
parenta14baf71b91845a7f68438d48f462cb754699ae2 (diff)
downloadlinux-e946b209c2ed15b1f7917def8fe6602747c3f771.tar.xz
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. Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/ion/ion_page_pool.c')
-rw-r--r--drivers/staging/android/ion/ion_page_pool.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c
index 855f30c..979d2e4 100644
--- a/drivers/staging/android/ion/ion_page_pool.c
+++ b/drivers/staging/android/ion/ion_page_pool.c
@@ -34,13 +34,8 @@ static void *ion_page_pool_alloc_pages(struct ion_page_pool *pool)
if (!page)
return NULL;
- /* this is only being used to flush the page for dma,
- this api is not really suitable for calling from a driver
- but no better way to flush a page for dma exist at this time */
- arm_dma_ops.sync_single_for_device(NULL,
- pfn_to_dma(NULL, page_to_pfn(page)),
- PAGE_SIZE << pool->order,
- DMA_BIDIRECTIONAL);
+ ion_pages_sync_for_device(NULL, page, PAGE_SIZE << pool->order,
+ DMA_BIDIRECTIONAL);
return page;
}