aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2012-02-29 08:45:28 -0500
committerMarek Szyprowski <m.szyprowski@samsung.com>2012-05-21 09:06:12 -0400
commit553ac78877242b6d8b591323731df304140d0f99 (patch)
treefe826ee0134b8a97df9350648f85a94edd06f042 /arch/arm/common
parent6b6f770b573903f8a7d1cfab1fc662685653f413 (diff)
ARM: dma-mapping: introduce DMA_ERROR_CODE constant
Replace all uses of ~0 with DMA_ERROR_CODE, what should make the code easier to read. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-By: Subash Patel <subash.ramaswamy@linaro.org>
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/dmabounce.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 595ecd290ebf..210ad1bef7e5 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -254,7 +254,7 @@ static inline dma_addr_t map_single(struct device *dev, void *ptr, size_t size,
254 if (buf == NULL) { 254 if (buf == NULL) {
255 dev_err(dev, "%s: unable to map unsafe buffer %p!\n", 255 dev_err(dev, "%s: unable to map unsafe buffer %p!\n",
256 __func__, ptr); 256 __func__, ptr);
257 return ~0; 257 return DMA_ERROR_CODE;
258 } 258 }
259 259
260 dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", 260 dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n",
@@ -320,7 +320,7 @@ dma_addr_t __dma_map_page(struct device *dev, struct page *page,
320 320
321 ret = needs_bounce(dev, dma_addr, size); 321 ret = needs_bounce(dev, dma_addr, size);
322 if (ret < 0) 322 if (ret < 0)
323 return ~0; 323 return DMA_ERROR_CODE;
324 324
325 if (ret == 0) { 325 if (ret == 0) {
326 __dma_page_cpu_to_dev(page, offset, size, dir); 326 __dma_page_cpu_to_dev(page, offset, size, dir);
@@ -329,7 +329,7 @@ dma_addr_t __dma_map_page(struct device *dev, struct page *page,
329 329
330 if (PageHighMem(page)) { 330 if (PageHighMem(page)) {
331 dev_err(dev, "DMA buffer bouncing of HIGHMEM pages is not supported\n"); 331 dev_err(dev, "DMA buffer bouncing of HIGHMEM pages is not supported\n");
332 return ~0; 332 return DMA_ERROR_CODE;
333 } 333 }
334 334
335 return map_single(dev, page_address(page) + offset, size, dir); 335 return map_single(dev, page_address(page) + offset, size, dir);