diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2014-01-27 10:47:05 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-07 22:35:30 +0400 |
commit | ab0c069ab59aba0dd21b3e52e81a88f2c21e4448 (patch) | |
tree | 8e4f20497918808700310e283d80c275816d148e /drivers/staging | |
parent | 114efd70707897d02790617012c5da1847911943 (diff) | |
download | linux-ab0c069ab59aba0dd21b3e52e81a88f2c21e4448.tar.xz |
staging: ion: Use PTR_ERR_OR_ZERO
PTR_RET is deprecated. Use PTR_ERR_OR_ZERO instead.
While at it also use PTR_ERR_OR_ZERO in ion.c to simplify
the code.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/android/ion/ion.c | 5 | ||||
-rw-r--r-- | drivers/staging/android/ion/ion_heap.c | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 574066ff73f8..b3395924f03e 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -16,6 +16,7 @@ */ #include <linux/device.h> +#include <linux/err.h> #include <linux/file.h> #include <linux/freezer.h> #include <linux/fs.h> @@ -1017,9 +1018,7 @@ static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, size_t start, mutex_lock(&buffer->lock); vaddr = ion_buffer_kmap_get(buffer); mutex_unlock(&buffer->lock); - if (IS_ERR(vaddr)) - return PTR_ERR(vaddr); - return 0; + return PTR_ERR_OR_ZERO(vaddr); } static void ion_dma_buf_end_cpu_access(struct dma_buf *dmabuf, size_t start, diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c index 296c74f98dc0..03cc43222b50 100644 --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c @@ -247,7 +247,7 @@ int ion_heap_init_deferred_free(struct ion_heap *heap) if (IS_ERR(heap->task)) { pr_err("%s: creating thread for deferred free failed\n", __func__); - return PTR_RET(heap->task); + return PTR_ERR_OR_ZERO(heap->task); } return 0; } |