From patchwork Fri Dec 13 22:24:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22445 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6454524006 for ; Fri, 13 Dec 2013 22:28:16 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id a41sf4758221yho.0 for ; Fri, 13 Dec 2013 14:28:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=HYvyyFV4e5bZLn1gkGAnvH4Y8M2l41stueZC2jDTVm0=; b=jj0s5hDlTSCCIetN++0PLz6kAB0km0Iux3k4bTqTIsP+rZqTuV7jG5ozk7F7K4TnHC syKYtK3664jJYDEft7waPcZ8aRxW6ailNku+NdRhiVjHV0hgyo6k9Y4A3WUIZng40YUY LYxOo1zARNt/ORxQx6+Q12bz06If/EYCaY7QQg3do9i+klBvzLb1TsCdQuRUd2JRslmi Mva9IAo2mWCU53Pq5vfhN7QXuphia6oJODSZaljQ7yMDMV99kUcLp6NZIaXPu8dw2Pqb OvYhyO+mkgDiY/v0qWMaDRaxScNYz6n4s0RdJFhMdXMMn8HOr2jXwmOGxk3mCKGmFpcG kJSw== X-Gm-Message-State: ALoCoQmm/LtwQJIOEjtTPpywayHNuT4awXvXpgFj7JwAYAI1QkFfvw1FPKtv7+k6zgNPdfCUCG0U X-Received: by 10.224.55.81 with SMTP id t17mr1848358qag.3.1386973696222; Fri, 13 Dec 2013 14:28:16 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.2.41 with SMTP id 9ls1157383qer.99.gmail; Fri, 13 Dec 2013 14:28:16 -0800 (PST) X-Received: by 10.221.26.4 with SMTP id rk4mr433423vcb.70.1386973695944; Fri, 13 Dec 2013 14:28:15 -0800 (PST) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id t2si1202971vem.28.2013.12.13.14.28.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:15 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jy13so1826057veb.41 for ; Fri, 13 Dec 2013 14:28:15 -0800 (PST) X-Received: by 10.220.199.5 with SMTP id eq5mr2274784vcb.16.1386973695878; Fri, 13 Dec 2013 14:28:15 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp73615vcz; Fri, 13 Dec 2013 14:28:15 -0800 (PST) X-Received: by 10.66.13.138 with SMTP id h10mr6037570pac.148.1386973683568; Fri, 13 Dec 2013 14:28:03 -0800 (PST) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by mx.google.com with ESMTPS id d2si2514421pba.91.2013.12.13.14.28.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.41; Received: by mail-pb0-f41.google.com with SMTP id jt11so3152454pbb.14 for ; Fri, 13 Dec 2013 14:28:03 -0800 (PST) X-Received: by 10.67.5.131 with SMTP id cm3mr6096920pad.92.1386973683190; Fri, 13 Dec 2013 14:28:03 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id qz9sm7457908pbc.3.2013.12.13.14.28.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:02 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , John Stultz Subject: [PATCH 074/115] ion: convert map_kernel to return ERR_PTR Date: Fri, 13 Dec 2013 14:24:48 -0800 Message-Id: <1386973529-4884-75-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> References: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Colin Cross ion is going to stop accepting NULL as an error value, use ERR_PTR. Signed-off-by: Colin Cross [jstultz: modified patch to apply to staging directory] Signed-off-by: John Stultz --- drivers/staging/android/ion/ion_carveout_heap.c | 7 ++++++- drivers/staging/android/ion/ion_heap.c | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c index fd64168..36df34c 100644 --- a/drivers/staging/android/ion/ion_carveout_heap.c +++ b/drivers/staging/android/ion/ion_carveout_heap.c @@ -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, diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c index cc2a425..a584ec0 100644 --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c @@ -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; }