From patchwork Wed Jul 11 09:40:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathyush K X-Patchwork-Id: 1181581 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 01B3FDF25A for ; Wed, 11 Jul 2012 10:34:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E456BA0937 for ; Wed, 11 Jul 2012 03:34:47 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E9AFA0DB3 for ; Wed, 11 Jul 2012 02:26:48 -0700 (PDT) Received: from epcpsbgm1.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M6Z00BNVOVZQCM0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 11 Jul 2012 18:26:30 +0900 (KST) X-AuditID: cbfee61a-b7f616d000004b7e-d7-4ffd46c564d5 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id FF.81.19326.5C64DFF4; Wed, 11 Jul 2012 18:26:29 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M6Z007HWOV41490@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 11 Jul 2012 18:26:29 +0900 (KST) From: Prathyush K To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/7] ARM: dma-mapping: rename and export iommu_ops Date: Wed, 11 Jul 2012 15:10:00 +0530 Message-id: <1341999603-28316-5-git-send-email-prathyush.k@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1341999603-28316-1-git-send-email-prathyush.k@samsung.com> References: <1341999603-28316-1-git-send-email-prathyush.k@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJMWRmVeSWpSXmKPExsVy+t9jAd2jbn/9DdqeWFlc+fqezYHR4373 caYAxigum5TUnMyy1CJ9uwSujB+T3zEV7OWrOLJjDlsD40SeLkZODgkBE4krB7sZIWwxiQv3 1rN1MXJxCAksYpQ4N6OXGcJZzSRxadF1JpAqNgFtiV9z7rKC2CICyhJ/J64C62YWyJS48nUL mC0s4CTxZMYZZhCbRUBV4vDiN2A2r4C7xKP5r5ggtilItC47xA5icwp4SGyd+wGsVwio5v62 lewTGHkXMDKsYhRNLUguKE5KzzXUK07MLS7NS9dLzs/dxAj2+jOpHYwrGywOMQpwMCrx8Dq4 /vUXYk0sK67MPcQowcGsJML71REoxJuSWFmVWpQfX1Sak1p8iFGag0VJnNfY+6u/kEB6Yklq dmpqQWoRTJaJg1OqgXGb2PxioQMeagKvLsubvJ35eIqLQPWyzI+J7Nf4Qh4ZMsu5V+6/oCXS MCu4oPqOMofk/ZrN15rWLSz9y/BLuod5tly7gJbSym7/Vw/e//qltiGr5Va9woe2Fz1aa+uV D+Yu86/RKfWq8393MVquKSYwY4VOpJ3l52r7qa1fL9b+rPBv2XmnT4mlOCPRUIu5qDgRAGEq hTH2AQAA X-TM-AS-MML: No X-Mailman-Approved-At: Wed, 11 Jul 2012 03:27:42 -0700 Cc: inki.dae@samsung.com, subash.ramaswamy@linaro.org, m.szyprowski@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org This patch renames the dma_ops structure for arm from iommu_ops to arm_iommu_ops. This structure is also exported and declared extern so that it can be set as any device's dma ops directly. Signed-off-by: Prathyush K --- arch/arm/include/asm/dma-mapping.h | 1 + arch/arm/mm/dma-mapping.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index bbef15d..5957357 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -13,6 +13,7 @@ #define DMA_ERROR_CODE (~0) extern struct dma_map_ops arm_dma_ops; +extern struct dma_map_ops arm_iommu_ops; static inline struct dma_map_ops *get_dma_ops(struct device *dev) { diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 0f9358b..cff13ac 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1567,7 +1567,7 @@ static void arm_iommu_sync_single_for_device(struct device *dev, __dma_page_cpu_to_dev(page, offset, size, dir); } -struct dma_map_ops iommu_ops = { +struct dma_map_ops arm_iommu_ops = { .alloc = arm_iommu_alloc_attrs, .free = arm_iommu_free_attrs, .mmap = arm_iommu_mmap_attrs, @@ -1582,6 +1582,7 @@ struct dma_map_ops iommu_ops = { .sync_sg_for_cpu = arm_iommu_sync_sg_for_cpu, .sync_sg_for_device = arm_iommu_sync_sg_for_device, }; +EXPORT_SYMBOL(arm_iommu_ops); /** * arm_iommu_create_mapping @@ -1674,7 +1675,7 @@ int arm_iommu_attach_device(struct device *dev, kref_get(&mapping->kref); dev->archdata.mapping = mapping; - set_dma_ops(dev, &iommu_ops); + set_dma_ops(dev, &arm_iommu_ops); pr_info("Attached IOMMU controller to %s device.\n", dev_name(dev)); return 0;