From patchwork Fri Dec 13 22:25:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22457 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F121F23FBA for ; Fri, 13 Dec 2013 22:28:33 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id tp5sf8954970ieb.5 for ; Fri, 13 Dec 2013 14:28:33 -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=PtpShWDrLutOoS+fmdvEYQlmGvT2KMsme5ahihcb0+g=; b=C+7bEj5lGdVFQPmNM3HZx6BvFYNt6zbCFARwEQvoPNOqq1uAf30gbB6sqZa5BLAhjd gVtAdysP8FtPsjK8Zt2jHsGtUvyYdPcDaLnt/R3XE1g7OT2RYu2Kagr1r/nALe4HcE1Z ZJcuJFJbv2ipUpfSPWU8Gg56VShCtiTHbJTX1xWpKEPRJ4PBMzDiD5pnOWc2EcpLnqj3 1ee3P20bNX0ek2l4Veg7kMzbdRh/QQpy0rhG5l+HN+XyaZuTXQN9omenfgyI2h+/TO2A aOp6sbWC2JPxAE6fympiVsqlu2ErPWUNFOn4X1fe0p1LCiqVXVjtV6YouuIsGkQtGpkw khgg== X-Gm-Message-State: ALoCoQlS1uiIXFcPQRIHcOEyPWGOF5sj+6qnWlOP9tUGCa0umGKGldTbm0O0wSM0DediCqSkAVbk X-Received: by 10.182.19.231 with SMTP id i7mr1890837obe.25.1386973713649; Fri, 13 Dec 2013 14:28:33 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.165 with SMTP id d5ls1239789qed.77.gmail; Fri, 13 Dec 2013 14:28:33 -0800 (PST) X-Received: by 10.52.75.99 with SMTP id b3mr930208vdw.80.1386973713528; Fri, 13 Dec 2013 14:28:33 -0800 (PST) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id at4si1202226ved.37.2013.12.13.14.28.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:33 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.170 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.170; Received: by mail-ve0-f170.google.com with SMTP id oy12so1870273veb.1 for ; Fri, 13 Dec 2013 14:28:33 -0800 (PST) X-Received: by 10.52.171.227 with SMTP id ax3mr1851582vdc.34.1386973713445; Fri, 13 Dec 2013 14:28:33 -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 u4csp73642vcz; Fri, 13 Dec 2013 14:28:33 -0800 (PST) X-Received: by 10.68.231.105 with SMTP id tf9mr6151848pbc.4.1386973712330; Fri, 13 Dec 2013 14:28:32 -0800 (PST) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by mx.google.com with ESMTPS id vv1si2438026pbb.239.2013.12.13.14.28.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.44; Received: by mail-pb0-f44.google.com with SMTP id rq2so3130968pbb.17 for ; Fri, 13 Dec 2013 14:28:32 -0800 (PST) X-Received: by 10.66.246.229 with SMTP id xz5mr6003265pac.128.1386973711899; Fri, 13 Dec 2013 14:28:31 -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.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:31 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , John Stultz Subject: [PATCH 092/115] ion: don't use __arm_ioremap to map pages Date: Fri, 13 Dec 2013 14:25:06 -0800 Message-Id: <1386973529-4884-93-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.170 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_heap_map_kernel already implements mapping a scatterlist of pages into the kernel, and all heaps are required to have struct pages associated with them, so delete the functions that use __arm_ioremap and use ion_heap_map_kernel instead. Signed-off-by: Colin Cross Signed-off-by: John Stultz --- drivers/staging/android/ion/ion_carveout_heap.c | 42 ++----------------------- drivers/staging/android/ion/ion_chunk_heap.c | 2 -- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c index 36df34c..051363a 100644 --- a/drivers/staging/android/ion/ion_carveout_heap.c +++ b/drivers/staging/android/ion/ion_carveout_heap.c @@ -25,8 +25,6 @@ #include "ion.h" #include "ion_priv.h" -#include - struct ion_carveout_heap { struct ion_heap heap; struct gen_pool *pool; @@ -109,49 +107,15 @@ void ion_carveout_heap_unmap_dma(struct ion_heap *heap, sg_free_table(buffer->sg_table); } -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; - - 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, - struct ion_buffer *buffer) -{ - __arm_iounmap(buffer->vaddr); - buffer->vaddr = NULL; - return; -} - -int ion_carveout_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer, - struct vm_area_struct *vma) -{ - return remap_pfn_range(vma, vma->vm_start, - __phys_to_pfn(buffer->priv_phys) + vma->vm_pgoff, - vma->vm_end - vma->vm_start, - pgprot_noncached(vma->vm_page_prot)); -} - static struct ion_heap_ops carveout_heap_ops = { .allocate = ion_carveout_heap_allocate, .free = ion_carveout_heap_free, .phys = ion_carveout_heap_phys, .map_dma = ion_carveout_heap_map_dma, .unmap_dma = ion_carveout_heap_unmap_dma, - .map_user = ion_carveout_heap_map_user, - .map_kernel = ion_carveout_heap_map_kernel, - .unmap_kernel = ion_carveout_heap_unmap_kernel, + .map_user = ion_heap_map_user, + .map_kernel = ion_heap_map_kernel, + .unmap_kernel = ion_heap_unmap_kernel, }; struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data) diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c index 62f7439..d3363d6 100644 --- a/drivers/staging/android/ion/ion_chunk_heap.c +++ b/drivers/staging/android/ion/ion_chunk_heap.c @@ -25,8 +25,6 @@ #include "ion.h" #include "ion_priv.h" -#include - struct ion_chunk_heap { struct ion_heap heap; struct gen_pool *pool;