Commit dfc4a9b1 authored by Colin Cross's avatar Colin Cross Committed by Greg Kroah-Hartman

ion: convert map_kernel to return ERR_PTR

ion is going to stop accepting NULL as an error value, use ERR_PTR.
Signed-off-by: default avatarColin Cross <ccross@android.com>
[jstultz: modified patch to apply to staging directory]
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2540c73a
......@@ -112,13 +112,18 @@ void ion_carveout_heap_unmap_dma(struct ion_heap *heap,
void *ion_carveout_heap_map_kernel(struct ion_heap *heap,
struct ion_buffer *buffer)
{
void *ret;
int mtype = MT_MEMORY_NONCACHED;
if (buffer->flags & ION_FLAG_CACHED)
mtype = MT_MEMORY;
return __arm_ioremap(buffer->priv_phys, buffer->size,
ret = __arm_ioremap(buffer->priv_phys, buffer->size,
mtype);
if (ret == NULL)
return ERR_PTR(-ENOMEM);
return ret;
}
void ion_carveout_heap_unmap_kernel(struct ion_heap *heap,
......
......@@ -56,6 +56,9 @@ void *ion_heap_map_kernel(struct ion_heap *heap,
vaddr = vmap(pages, npages, VM_MAP, pgprot);
vfree(pages);
if (vaddr == NULL)
return ERR_PTR(-ENOMEM);
return vaddr;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment