staging: ion: Use PTR_ERR_OR_ZERO
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 27 Jan 2014 06:47:05 +0000 (12:17 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Feb 2014 18:35:30 +0000 (10:35 -0800)
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>
drivers/staging/android/ion/ion.c
drivers/staging/android/ion/ion_heap.c

index 574066ff73f80d48777ba3189e89fb1ac4f8ad0c..b3395924f03e45a280082063d1dd2b74f6425f3e 100644 (file)
@@ -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,
index 296c74f98dc08c6cabbd8203fc4b535b59aedf30..03cc43222b50df9f70396a0b7d014feb42367f08 100644 (file)
@@ -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;
 }